Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SalesCalculator
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- double salesTotal = 0;
- double Bonus;
- double FinalPay;
- System.out.print("Enter value of item or -1 to quit: ");
- double item = input.nextInt();
- while (item != -1)
- {
- salesTotal = salesTotal + item;
- System.out.print("Enter value of item or -1 to quit: ");
- item = input.nextInt();
- }
- Bonus = salesTotal * .09 + 200;
- FinalPay = salesTotal + Bonus;
- System.out.printf("Your total payment is: ", FinalPay);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement