Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package bill;
  7. import java.util.Scanner;
  8. /**
  9.  *
  10.  * @author Jake
  11.  */
  12. public class Bill {
  13.     static Scanner scan = new Scanner(System.in);
  14.     /**
  15.      * @param args the command line arguments
  16.      */
  17.     public static void main(String[] args) {
  18.         String itemOne, itemTwo, itemThree;
  19.         int quantityOne, quantityTwo, quantityThree;
  20.         double priceOne, priceTwo, priceThree;
  21.        
  22.         System.out.println("Input name of item 1:");
  23.         itemOne = scan.nextLine();
  24.         System.out.println("Input quantity of item 1:");
  25.         quantityOne = scan.nextInt();
  26.         System.out.println("Input price of item 1:");
  27.         priceOne = scan.nextDouble();
  28.        
  29.         System.out.println("Input name of item 2:");
  30.         itemTwo = scan.nextLine();
  31.         System.out.println("Input quantity of item 2:");
  32.         quantityTwo = scan.nextInt();
  33.         System.out.println("Input price of item 2:");
  34.         priceTwo = scan.nextDouble();
  35.        
  36.         System.out.println("Input name of item 3:");
  37.         itemThree = scan.nextLine();
  38.         System.out.println("Input quantity of item 3:");
  39.         quantityThree = scan.nextInt();
  40.         System.out.println("Input price of item 3:");
  41.         priceThree = scan.nextDouble();
  42.        
  43.         System.out.println("");
  44.         System.out.println("Your bill:");
  45.         System.out.println("");
  46.        
  47.         System.out.print("Item %30");
  48.         System.out.print("Price %10");
  49.     }
  50.    
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement