Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- import java.util.Scanner;
- /**
- *
- * @author user
- */
- public class JavaApplication1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- double subtotal,grat,total,gratrate;
- Scanner input = new Scanner(System.in);
- System.out.println("Please Insert The Subtotal: ");
- subtotal = input.nextInt();
- System.out.print("Please Insert The Gratuity rate: ");
- gratrate = input.nextInt();
- grat = ((gratrate/subtotal) * 100);
- total = subtotal + grat;
- System.out.println("Your Gratuity is: "+grat);
- System.out.println("Your total is "+total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement