How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Raj Your Own Question
Raj
Raj, Engineer
Category: Homework
Satisfied Customers: 1290
Experience:  4 + Experiance in IT Industry
16752232
Type Your Homework Question Here...
Raj is online now
A new question is answered every 9 seconds

Create a class named rates that has the following data members:

This answer was rated:

Create a class named rates that has the following data members:
Income limit; use read-only accessor.
Low tax rate; use read-only accessor.
High tax rate; use read-only accessor.
A class constructor that assigns default values of limit=30000, low rate = .15 and high rate = .28.
A class constructor that takes three parameters to assign input values for limit, low rate and high rate.
A CalculateTax method that takes an income parameter and computes the tax as follows:
If income is less than the limit then return the tax as income times low rate.
If income is greater than or equal to the limit then return the tax as income times high rate.
Create a class named Taxpayer that has the following data members:
Social Security number (use type string, no dashes between groups). Use get and set accessors.
Yearly gross income. Use get and set accessors.
Tax owed. Use read-only accessor.
The Taxpayer class should be set up so that its objects are comparable to each other based on tax owed.
The tax should be calculated whenever the income is set.
The Taxpayer class should have a getRates class method that has the following:
Local method data members for income limit, low rate and high rate.
Prompt the user to enter a selection for either default settings or user input of settings.
If the user selects default the default values you will instantiate a rates object using the default constructor and set the Taxpayer class data member for tax equal to the value returned from calling the rates object CalculateTax method.
If the user selects to enter the rates data then prompt the user to enter values for income limit, low rate and high rate, instantiate a rates object using the three-argument constructor passing those three entries as the constructor arguments and set the Taxpayer class data member for tax equal to the value returned from calling the rates object CalculateTax method.
In Main:
instantiate an array of five (5) Taxpayer objects.
Implement a for-loop that will prompt the user to enter the Social Security Number and gross income.
Implement a for-loop that will display each object as formatted taxpayer SSN, income and calculated tax.
Implement a for-loop that will sort the five objects in order by the amount of tax owed and then display each object as formatted taxpayer SSN, income and calculated tax.
Internal documentation.
Possible output for the program would look like this:

Enter Social Security Number for taxpayer 1 XXXXXXXXX
Enter gross income for taxpayer 1 35000
Do you want default values (enter D) or enter your own (enter O)? d
Enter Social Security Number for taxpayer 2 XXXXXXXXX
Enter gross income for taxpayer 2 80000
Do you want default values (enter D) or enter your own (enter O)? o
Enter the dollar limit 50000
Enter the low rate .15
Enter the high rate .25
Enter Social Security Number for taxpayer 3 XXXXXXXXX
Enter gross income for taxpayer 3 45000
Do you want default values (enter D) or enter your own (enter O)? d
Enter Social Security Number for taxpayer 4 XXXXXXXXX
Enter gross income for taxpayer 4 65000
Do you want default values (enter D) or enter your own (enter O)? o
Enter the dollar limit 70000
Enter the low rate .10
Enter the high rate .20
Enter Social Security Number for taxpayer 5 XXXXXXXXX
Enter gross income for taxpayer 5 70000
Do you want default values (enter D) or enter your own (enter O)? d
Taxpayer # XXXXX SSN: XXXXXXXXX income $35,000.00 Tax is $9,800.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $80,000.00 Tax is $20,000.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $45,000.00 Tax is $12,600.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $65,000.00 Tax is $6,500.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $70,000.00 Tax is $19,600.00

--------------------------------

Taxpayer # XXXXX SSN: XXXXXXXXX income $65,000.00 Tax is $6,500.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $35,000.00 Tax is $9,800.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $45,000.00 Tax is $12,600.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $70,000.00 Tax is $19,600.00
Taxpayer # XXXXX SSN: XXXXXXXXX income $80,000.00 Tax is $20,000.00
Press any key to continue . . .
Hi There,

I will be helping you with the required solution.
Can you please provide the Programming language in which you need the solution?

Thank you
Customer: replied 4 years ago.

c++

Okay, Can you also let me know the deadline for the solution?
Customer: replied 4 years ago.

may 16

Is it fine if I provide you solution in next 24 hrs?
Customer: replied 4 years ago.

Ok

Okay than I am working on your Requirement and will be posting the solution in next 24 hrs. from now.

Have a Good Day
Customer: replied 4 years ago.
Sorry. I need tha solution in c#. Thank You.
Customer: replied 4 years ago.
C# XXXXX
Ok I will have it ready in C#
Customer: replied 4 years ago.
Thanks.
Customer: replied 4 years ago.
Hi,
I will get it today right.
Yes
Customer: replied 4 years ago.
How long does it take now?
How much time is left?
Customer: replied 4 years ago.
You can give me 3-4 hours.
Ok No Problem. Code will be ready by then....
Customer: replied 4 years ago.
So, Is it almost done?
Yes Just checking the Output....
Customer: replied 4 years ago.
Ok
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Raj and other Homework Specialists are ready to help you
Customer: replied 4 years ago.
Do I need I comparable here?
I have included the comparable using the option of overloading the operator < and > in the class so that part is implemented in the code.
Customer: replied 4 years ago.
Thanks.
Customer: replied 4 years ago.
Awesome.

Related Homework Questions