Question

Use Dev-C++ to create a program using the program requirements listed below. Write a program that...

Use Dev-C++ to create a program using the program requirements listed below.

Write a program that displays the income tax due in the state of Euphoria on a taxable income (in whole dollars) entered by the user, according to the tax table shown in Table 11.1.

Table 11.1 Tax table

Taxable Income

From -To Tax Due
$0 - $49,999 $0 + 5% of amount over $0
$50,000 - $99,999 $2,500 + 7% of amount over $50,000
$100,000... $6,000 + 9% of amount over $100,000

The program should allow the user to enter a series of incomes, terminated by 0. Use a class called Tax, with attributes Income and TaxDue and methods that include ComputeTax() and access methods (SetIncome(), GetIncome(), SetTaxDue(), and GetTaxDue()) for each of the attributes.

Prelude to Programming (6th Edition)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
=================================


#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>

using namespace std;

class Tax
{
private :
   double taxDue;
   double income;
   public :  
   Tax(double income)
   {
       this->income=income;
       }
       double getIncome()
       {
           return income;
       }
       double getTaxDue()
       {
           return taxDue;
       }
       void setIncome(double income)
       {
           this->income=income;
       }
       void setTaxDue(double tax)
       {
           this->taxDue=tax;
       }
      
       double computeTax()
       {
           if(income>=0 && income<49999)
           {
               taxDue=0;
           }
           else if(income>=50000 && income<99999)
           {
               taxDue=2500+(income-50000)*0.07;
           }
           else if(income>=100000)
           {
               taxDue=6000+(income-100000)*0.09;
           }
          
           return taxDue;
       }
};
int main() {
   //Declaring variables
   double income;
cout<<"Enter Income :$";
cin>>income;
Tax t(income);
cout<<"Tax Due is :$"<<t.computeTax()<<endl;
  
   return 0;
}

======================================

Output:

C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\Class Tax.exe Enter Income :$90000 Tax Due is :$5300 Process exited after 2.908 se

=====================Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
Use Dev-C++ to create a program using the program requirements listed below. Write a program that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Compute the income tax due on taxable income entered by the user, given the data as...

    Compute the income tax due on taxable income entered by the user, given the data as shown in the following table. Be sure to include error checking to make sure the user does not enter a negative number. Assume all entries are integer values. Taxable Income Tax Due From To $49,999 $0 +5% of amount over $0 $0 $50,000 $99,999 $2,500 7% of amount over $50,000 $100,000 $6,000 9% of amount over $100,000 +

  • (python only) Write a program that asks the user for their filing status (single or married)...

    (python only) Write a program that asks the user for their filing status (single or married) and their taxable income. Then, using the below table, compute the tax owed and display the filing status, taxable income, and tax owed. If the filing status is single and the taxable income is overbut not over   the tax is of the amount over$0$9,52510%0$9,526$38,700$952.50 + 12%$9,525$38,701$82,500$4,453.50 +22% $38,700 $82,501unlimited$14,089.50 +24% $82,500 If the filing status is married filing jointly and the taxable income is overbut...

  • Write a Python program that computes the income tax for an individual. The program should ask...

    Write a Python program that computes the income tax for an individual. The program should ask the user to enter the total taxable income for the year. The program then uses the tax bracket (as shown below) to calculate the tax amount. This is based on a progressive income tax system which is how income tax is calculated in the U.S. As a result, this for example means that only income above $500,001 is taxed at 37%. Income of lower...

  • Please write in MATLAB code Write a program that can calculate the amount of federal tax...

    Please write in MATLAB code Write a program that can calculate the amount of federal tax a person owes for the upcoming year. After calculating the amount of tax owed, you should report to the user their filing status (single/joint), which tax rate they fell under, as well as the tax owed. Example: “As a single filer you fell under 12% tax bracket and you owe $3500.” Disclaimer: This example is simplified and is not intended to be an accurate...

  • I HAVE TO SOLVE A C++ PROGRAM, THIS ARE THE INSTRUCTIONS: Write a program that can...

    I HAVE TO SOLVE A C++ PROGRAM, THIS ARE THE INSTRUCTIONS: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax...

  • Language C++ Write a program that can be used to calculate the federal tax. The tax...

    Language C++ Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax...

  • Please answer in excel. Please show the formulas EXCEL MASTER IT! PROBLEM Using Excel to find...

    Please answer in excel. Please show the formulas EXCEL MASTER IT! PROBLEM Using Excel to find the marginal tax rate can be accomplished using the VLOOKUP func- tion. However, calculating the total tax bill is a little more difficult. Below we have shown a copy of the IRS tax table for an unmarried individual for 2018. Often, tax tables are presented in this format. xlsx If taxable income is But not over . $ 9,525 38,700 93,700 195,450 424,950 426,700...

  • Using the corporate tax rate table, calculate the taxable amount if a corporation's taxable income is...

    Using the corporate tax rate table, calculate the taxable amount if a corporation's taxable income is 16,000,000 It Pays This Plus This Percentage Average Tax If a Corporation's Amount on the on the Excess over the Rate at Taxable income is Base of the Bracket Base (Marginal Rate) Top of Bracket Up to $50,000 $ 0 15% 15.0% $50,000-$75,000 7,500 25 18.3 $75,000-$100,000 13,750 34 22.3 $100,000-$335,000 22,250 39 34.0 $335,000-$10,000,000 113,900 34 34.0 $10,000,000 $15,000,000 3,400,000 35 34.3 $15,000,000-$18,333,333...

  • QUESTION 32 Using the corporate tax rate table, calculate the taxable amount if a corporation's taxable...

    QUESTION 32 Using the corporate tax rate table, calculate the taxable amount if a corporation's taxable income is 83,000 It Pays This Plus This Percentage Average Tax If a Corporation's Amount on the on the Excess over the Rate at Taxable income is Base of the Bracket Base (Marginal Rate) Top of Bracket Up to $50,000 $ 0 15% 15.0% $50,000-$75,000 7,500 25 183 $75,000-$100,000 13,750 34 22.3 $100,000-$335,000 22,250 39 34.0 $335,000-$10,000,000 113,900 34 34.0 $10,000,000-$15,000,000 3,400,000 35 34.3...

  • Write a java program: Create a method fillRandom() that accepts an array of int as input...

    Write a java program: Create a method fillRandom() that accepts an array of int as input and populates it with random numbers in the range -999 to 1000 Explicitly store zero in index [0] and 900 in index [1]. (0 and 900 will be used as search keys) Create a method DisplayLastInts() that accepts an array of int as input and displays the last hundred elements to the screen in rows of 10 elements. Format the output so the 10...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT