Question
Ok I need help with this problem. So I solved this problem. and now another problem needs the solution of the first modified into different
Ok I need help with this problem.
So I solved this problem. and now another problem needs the solution of the first modified into different conditions. check it out.
the question that I solved:
You find an exciting summer job for five weeks. It pays, say, $15.50 per hour. Suppose that the local tax you pay on your summer job income is 14%. After paying the taxes, you spend 10% of your net income to buy new clothes and other accessories for the next school year and 1% to buy school supplies. After buying clothes and school supplies, you use 25% of the remaining money to buy savings bonds. For each dollar you spend to buy savings bonds, your parents spend $0.50 to buy additional savings bonds for you. Write a program that prompts the user to enter the pay rate for an hour and the number of hours you worked each week.
So I got this code:
#include #include
using namespace std;
void main()
{
double hourlyWage, totalHoursworked, incomeBeforetax, incomeAftertax, additionalSavingsBonds, totalincome, spentONclothes, spentONsupplies, income, income_two, spentONbonds, summertax, clothes, schoolsupplies, savingsbonds;
summertax = 0.14; clothes = 0.10; schoolsupplies = 0.01; savingsbonds = 0.25;
cout << " Enter hourly wage: $"; cin >> hourlyWage; cout << " ";
cout << " Enter total hours worked: "; cin >> totalHoursworked; cout << " ";
totalincome = (hourlyWage * totalHoursworked); incomeBeforetax = totalincome; incomeAftertax = totalincome - (totalincome * summertax); spentONclothes = (incomeAftertax * clothes); income = incomeAftertax - spentONclothes; spentONsupplies = (income * schoolsupplies); income_two = income - spentONsupplies; spentONbonds = (income_two * savingsbonds); additionalSavingsBonds = spentONbonds * 0.50;
cout << " Your income before taxes from your summer job: $" << setprecision(2) << fixed << incomeBeforetax << endl << endl; cout << " Your income after taxes from your summer job: $" << setprecision(2) << fixed << incomeAftertax << endl << endl; cout << " The amount of money you spent on clothes: $" << setprecision(2) << fixed << spentONclothes << endl << endl; cout << " The amount you spent on school supplies: $" << setprecision(2) << fixed << spentONsupplies << endl << endl; cout << " The amount you spent on buying savings bonds: $" << setprecision(2) << fixed << spentONbonds << endl << endl; cout << " The money your parents spent to buy additional savings bonds: $" << setprecision(2) << fixed << additionalSavingsBonds << endl << endl;
}
Now this question is asking to change the data, but I got kind of confused about it. This is the part I need help with.
Redo the previous programming exercise, taking into account that your parents buy additional savings bond for you as follows:
[a] If you do not spend any money to buy savings bonds, then because you had a summer job, your parents buy savings bonds for you in an amount equal to 1% of the money you save after paying taxes and buying clothes, other accessories and school supplies.
[b] If you spend up to 25% of your net income to buy savings bonds, your parents spend $0.25 for each dollar you spend to buy savings bonds, plus money equal to 1% of the money you save after paying taxes and buying clothes, other accessories, and school supplies.
[c] If you spend more than 25% of your net income to buy savings bonds, your parents spend $0.40 for each dollar you spend to buy savings bonds, plus money equal to 2% of the money you save after paying taxes and buying clothes, other accessories, and school supplies.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started