Advertisement
Fakhru

Untitled

Jul 11th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package javaapplication1;
  6. import java.util.Scanner;
  7. /**
  8. *
  9. * @author user
  10. */
  11. public class JavaApplication1 {
  12.  
  13. /**
  14. * @param args the command line arguments
  15. */
  16. public static void main(String[] args) {
  17. double subtotal,grat,total,gratrate;
  18. Scanner input = new Scanner(System.in);
  19. System.out.println("Please Insert The Subtotal: ");
  20. subtotal = input.nextInt();
  21. System.out.print("Please Insert The Gratuity rate: ");
  22. gratrate = input.nextInt();
  23. grat = ((gratrate/subtotal) * 100);
  24. total = subtotal + grat;
  25. System.out.println("Your Gratuity is: "+grat);
  26. System.out.println("Your total is "+total);
  27.  
  28.  
  29.  
  30.  
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement