Java Programming

posted by .

I'm a beginner to Java and I need to know how to do the following:

Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax). Hint: Use the value 0.02 to represent 2 percent, and 0.04 to represent 4 percent.

Can anybody help me?

  • Java Programming -

    Here are some Java Programming tutorials:

    http://search.yahoo.com/search?fr=mcafee&p=Java+Programming+tutorial

    SRa

  • Java Programming -

    Post either pseudocode, or actual coding, in whatever shape they are in.

    If you do not know how to do either one of the two, post what you have learned, the name of your textbook, the chapters covered, and the course outline.

  • Java Programming -

    // Create a Scanner object to read input.
    Scanner keyboard = new Scanner(System.in);

    // Get the Purchase Amount
    System.out.print(" What is the Purchase Amount?");
    purchaseAmount=keyboard.nextDouble( );

    stateSalesTax=0.04*purchaseAmount;
    countySalesTax=0.02*purchaseAmount;
    totalSalesTax=stateSalesTax+countySalesTax;
    totalSale=totalSalesTax+purchaseAmount;


    System.out.println( " Purchase " + purchaseAmount);
    System.out.println( " State Tax " + stateSalesTax);
    System.out.println( " County Tax " + countySalesTax );
    System.out.println( " Total Tax " + totalSalesTax +"\n_________");
    System.out.println( " Total Sale " + totalSale);

    }
    }

  • Python Programming -

    A customer is in a store to purchase 6 items. Write a program which asks for the sales tax and the price of each item, then displays: 1. the subtotal of the sale 2. the total amount of tax to be collected 3. the total amount the customer must pay

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Programming Design

    Design a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county tax. Assume the state sales tax is 4 percent (.04) and the county tax is 2 percent (.02). The program should …
  2. programming

    Having troube with java, i am not a regular programmer, if anybody can help me out writting this program: write a program that takes two numbers from the java console representing, respectively, an investment and an interest rate(you …
  3. java

    can anyone help me with this? I'm new to java! Write a program that will find the lowest common denominator of two numbers. The user will enter the two denominators, the program will output both the lowest common denominator and the
  4. programming

    Write a program which allows user to enter 10 student names and scores for Java programming 1 and Java programming 2. Allow user to choose which course they want to enter the record for. Use the loop to ask input from user. The program …
  5. JAVA PROGRAMMING

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  6. java programming

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  7. intro to computer programming

    Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. Your program should use a loop …
  8. java programming

    the learner is asked to write a program using java with user input that caculate and displays, the number of months it will take the user to save an amount of money. the user must enter the
  9. programming

    Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should …
  10. Programming Java

    I am learning Java in programming right now. I need to write a program that should have an output like this: The program says "Type ten names". Then ten names sould be typed a person. Then the program chooses a random name from the …

More Similar Questions