5:05 My Courses Lab 2 Acceptance Criteria User will be prompted to enter the tot
ID: 3747122 • Letter: 5
Question
5:05 My Courses Lab 2 Acceptance Criteria User will be prompted to enter the total income earned for the year (dollars and cents) If what the user enters is not a valid numeric valid the application will alert the user, wait for the user to hit enter, and exit the application. Using the Federal tax brackets for the latest year known, calculate the effective tax rate, the tax bracket, and total amount of tax charged based on the income entered. · The application will display the relevant data through a mixture of string literals and properly formatted numeric data (see example output below). The data to be displayed is the total income tax calculated, the final tax bracket (highest bracket) in which the individual's income was taxed, and the effective tax rate (tax calculated/total income). Technical Requirements: The application will display the programmer's name and a title for the application. . The inco d by the userExplanation / Answer
//Hi student as you didn't mentioned the tax data hence i am using default please edit that
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaxManipulatorChegg
{
class Program
{
static void Main(string[] args)
{
//Show the title of application and Administartor Name
//Please mention your name here to be displayed as admin
string admin = "Tony Stark";
Console.WriteLine($"Welcome to Tax Delegation and Income Application designed by {admin}");
Console.WriteLine("Please Enter the income:");
double income;
//Use tryparse to handle exception
double.TryParse(Console.ReadLine(),out income);
if(income ==0)
{
Console.WriteLine("Wrong data");
throw new InvalidOperationException();
}
double interest = 0;
double tax = 0;
double saving = income;
Console.WriteLine("Choose appropriate Category");
Console.WriteLine("For single press 1");
Console.WriteLine("For married filling jointly press 2");
Console.WriteLine("For married filling separetly press 3");
Console.WriteLine("For head or household 4");
char s =(char) Console.Read();
switch (s)
{
case '1':
//I am using 18% tax rate
//Please update the tax rate tax bucket from specified data in your book
interest = 18;
tax = income * interest / 100;
saving = income - tax;
Console.WriteLine($"The income is :{income} tax deduction is :{tax} ,Remaining saving is: {saving}");
break;
case '2':
//I am using 23% tax rate
interest = 23;
tax = income * interest / 100;
saving = income - tax;
Console.WriteLine($"The income is :{income} tax deduction is :{tax} ,Remaining saving is: {saving}");
break;
case '3':
//I am using 24.5% tax rate
interest = 24.5;
tax = income * interest / 100;
saving = income - tax;
Console.WriteLine($"The income is :{income} tax deduction is :{tax} ,Remaining saving is: {saving}");
break;
case '4':
//I am using 28% tax rate
interest = 28;
tax = income * interest / 100;
saving = income - tax;
Console.WriteLine($"The income is :{income} tax deduction is :{tax} ,Remaining saving is: {saving}");
break;
default:
//I am using 18% tax rate
interest = 33;
tax = income * interest / 100;
saving = income - tax;
Console.WriteLine($"The income is :{income} tax deduction is :{tax} ,Remaining saving is: {saving}");
break;
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.