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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 5 of 5

Thread: need help

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

    Question need help

    hey, guys i it's me again please can you help me with this program .But here is the requirements:


    Here is a summer programming job for 5 weeks.it pay 15.50 per hour.Suppose that the total tax you pay on your summer job incomes is 14%.After paying the taxes, yoy spend 10% of your net income to buy new clothes and other accesories for the next school year and 1% to buy additional 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

    import java.util.*;
    class football 
    {static Scanner console = new Scanner(System.in);
    	public static void main(String[] args) 
    	{
    		double wages ;
    		double rate ;
    		double hours;
            double taxes;
    		double clothesexp;
            double twagesatax;
    		double schsupply;
    		double sbonds;
     
     
    		System.out.print("Enter hours worked:");
    			hours = console.nextDouble();
    		System.out.println();
     
    		System.out.print("Enter pay rate:");
    		 rate = console.nextDouble();
            System.out.println();
     
     
    			 wages = hours * rate;
     
             System.out.println("The wages are :"  + wages);
     
             System.out.println(" Total wages before taxes:" + wages );
     
    				  taxes = 14% * wages;
             System.out.println(" Total wages after taxes:" + twagesatax );
     
     
                  clothesexp = 10% * twagesatax; 
             System.out.println("Total money spend on clothes and other accessories :" + clothesexp );
     
    		 schsupply = 1% * (twagesatax + clothesexp);
             System.out.println("Total money spend on school supplies :" + schsupply );
     
    		 sbonds = 25% * (twagesatax + clothesexp + schsupply);
             System.out.println("Total money spend on saving bonds :" + sbonds );
     
     
     
     
     
     
    	}
    }
    Last edited by helloworld922; February 10th, 2010 at 03:38 PM. Reason: please use [code] tags

  2. #2
    Member
    Join Date
    Jan 2010
    Location
    Oxford, UK
    Posts
    30
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default Re: need help

    James, the correct way to put code tags around your code is...

    [ code ]
    This is my code
    [ /code ]

    ...but without the spaces between the brackets and "code" or "/code".

  3. #3
    Junior Member james's Avatar
    Join Date
    Jan 2010
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: need help

    hey shambolic, i need help in correcting and modifing my program.So, please if you could help me with if not don,t tell me about those things you mentioned above coz it has no help to me .

  4. #4
    Junior Member james's Avatar
    Join Date
    Jan 2010
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Red face Re: need help

    Hey guys i have made some changes into my program it has compiled but it only calculates for the wages and the rest it did not do any calculation with them.So, I was hoping that somebody out there viewing could help me out coz Iam so desperate right now.((:

     
    import java.util.*;
    class football 
    {
    	static Scanner console = new Scanner(System.in);
    	public static void main(String[] args) 
    	{
    		double wages ;
    		double rate ;
    		double hours;
    		double clothesexp;
            double twagesatax;
    		double schsupply;
    		double sbonds;
     
     
    		System.out.print("Enter hours worked:");
    			hours = console.nextDouble();
    		System.out.println();
     
    		System.out.print("Enter pay rate:");
    		 rate = console.nextDouble();
            System.out.println();
     
     
    			 wages = hours * rate;
     
            System.out.println("The wages are :"  + wages);
     
            System.out.println(" Total wages before taxes:" + wages );
     
    				  twagesatax = 14/100 * wages;
            System.out.println(" Total wages after taxes:" + twagesatax );
     
     
                  clothesexp = 10/100 * (wages - twagesatax); 
            System.out.println("Total money spend on clothes and other accessories :" + clothesexp );
     
    		 schsupply = 1/100 * (wages-(twagesatax + clothesexp));
            System.out.println("Total money spend on school supplies :" + schsupply );
     
    		 sbonds = 25/100 * (wages-(twagesatax + clothesexp + schsupply));
            System.out.println("Total money spend on saving bonds :" + sbonds );
     
     
     
     
     
     
    	}
    }
    Last edited by Json; February 11th, 2010 at 03:29 AM. Reason: Please use code tags

  5. #5
    Member
    Join Date
    Feb 2010
    Location
    Dehradun, India
    Posts
    37
    Thanks
    1
    Thanked 7 Times in 6 Posts

    Default Re: need help

    Hi james, This is your complete program. Use it and enjoy...and click on Thanks link plz

    import java.util.*;
    class football
    {
    	static Scanner console = new Scanner(System.in);
    	public static void main(String[] args)
    	{
    		double wages ;
    		double rate ;
    		double hours;
    		double clothesexp;
    		double twagesatax;
    		double schsupply;
    		double sbonds;
     
     
    		System.out.print("Enter hours worked:");
    		hours = console.nextDouble();
    		System.out.println();
     
    		System.out.print("Enter pay rate:");
    		rate = console.nextDouble();
    		System.out.println();
     
     
    		wages = hours * rate;
     
    		System.out.println("The wages are :" + wages);
     
    		System.out.println(" Total wages before taxes:" + wages );
     
    		twagesatax = (float)14/100 * wages;
    		System.out.println(" Total wages after taxes:" + twagesatax );
     
     
    		clothesexp = (float)10/100 * (wages - twagesatax);
    		System.out.println("Total money spend on clothes and other accessories :" + clothesexp );
     
    		schsupply = (float)1/100 * (wages-(twagesatax + clothesexp));
    		System.out.println("Total money spend on school supplies :" + schsupply );
     
    		sbonds = (float)25/100 * (wages-(twagesatax + clothesexp + schsupply));
    		System.out.println("Total money spend on saving bonds :" + sbonds );
     
     
     
     
     
     
    	}
    }
    Last edited by Json; February 11th, 2010 at 03:29 AM. Reason: Please use code tags

  6. The Following User Says Thank You to jassi For This Useful Post:

    james (February 11th, 2010)