you found an exciting summer programming job for five weeks. It pays $15.50 per
ID: 3628746 • Letter: Y
Question
you found an exciting summer programming job for five weeks. It pays $15.50 per hour. Suppose that the total 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 saving 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. The program then o utputs the following: your income before and after taxes from your summer job
Explanation / Answer
please rate - thanks
import java.util.*;
public class main
{public static void main(String args[])
{double pay;
double tax=14/100.;
double clothes=10/100.;
double supplies=1/100.;
double bonds=25/100.;
double income,taxes,clothesetc,school,savingsbonds,parents;
int hours=0,h,i;
Scanner in=new Scanner(System.in);
System.out.print("Enter your hourly salary: ");
pay=in.nextDouble();
System.out.print("Enter hours worked each week ");
for(i=1;i<=5;i++)
{System.out.print("week "+i+": ");
h=in.nextInt();
hours+=h;
}
income=hours*pay;
System.out.println("income before taxes: $"+income);
taxes=income*tax;
income-=taxes;
System.out.println("income after taxes: $"+income);
clothesetc=income*clothes;
System.out.println("The money you spend on clothes and other accessories $"+clothesetc);
income-=clothesetc;
school=income*supplies;
income-=school;
System.out.println("The money you spend on school supplies $"+school);
savingsbonds=income*bonds;
System.out.println("The money you spend on saving bonds $"+savingsbonds);
parents=savingsbonds/2.;
System.out.println("The money your parents spend on saving bonds $"+parents);
}}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.