Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: need help

  1. #1
    Junior Member james's Avatar
    Join Date
    Jan 2010
    Thanked 0 Times in 0 Posts

    Red face need help

    hey guys i really need some help with my program.here is the question:

    You found an exciting summer programming job for 5 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 saving bond, your parents spend$0.50 to buy additional saving bonds for
    you. Write a program that prompts the user to enter the pay rate for an hour and the
    number of hours worked each week. The program then outputs the following:
    a. Your income before and after taxes from your summer job
    b. The money you spend on clothes and other accessories
    c. The money you spend on school supplies
    d. The money you spend to buy saving bonds
    e. The money your parents spend to buy additional saving bonds for you

    And here is my program code please can you help me improve it.
    import java.util.*;
    class Question1
    	static Scanner console  = new Scanner(system.in);
    	public static void main(String[] args) 
    	final double RATE = 15.50;	
    	final double Total_Tax = 0.14;
    	double hourwork,income,netincome,moneyclothes,moneysupplies,moneysavingbond,moneyparent,remaingmoney;
    	System.out.println("Enter the number of hour work each week:");   //assumpition maximum number of hours per week is 40 hours
        hourwoke = console.nextDouble();
        if (hourwork <=40)
        income = RATE * hoursworked
    	netincome = income - (income * Total_Tax)
    	System.out.println("The total net income is :$" + netincome);
    	moneyclothes = netincome * 0.10;
    	System.out.println("The money spent on clothes and accessories:$" + moneyclothes);
    	moneysupplies = netincome * 0.01;
    	System.out.println("The money spent on school supplies:$" + moneysupplies); 
    	moneysavingbond = netincome * 0.25;
    	System.out.println("The money spent to buy saving bonds:$" + moneysavinmgbond); 
    	moneyparent= netincome * 0.5;
    	System.out.println("The money spent by parent to by additional saving bonds:$" + moneyparent);
    Last edited by helloworld922; May 21st, 2010 at 02:09 AM. Reason: please use [code] tags

  2. #2
    Senior Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Madgaon, Goa, India
    Thanked 48 Times in 46 Posts

    Default Re: need help

    James, check out my response on your other thread