Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package bill;
- import java.util.Scanner;
- /**
- *
- * @author Jake
- */
- public class Bill {
- static Scanner scan = new Scanner(System.in);
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- String itemOne, itemTwo, itemThree;
- int quantityOne, quantityTwo, quantityThree;
- double priceOne, priceTwo, priceThree;
- System.out.println("Input name of item 1:");
- itemOne = scan.nextLine();
- System.out.println("Input quantity of item 1:");
- quantityOne = scan.nextInt();
- System.out.println("Input price of item 1:");
- priceOne = scan.nextDouble();
- System.out.println("Input name of item 2:");
- itemTwo = scan.nextLine();
- System.out.println("Input quantity of item 2:");
- quantityTwo = scan.nextInt();
- System.out.println("Input price of item 2:");
- priceTwo = scan.nextDouble();
- System.out.println("Input name of item 3:");
- itemThree = scan.nextLine();
- System.out.println("Input quantity of item 3:");
- quantityThree = scan.nextInt();
- System.out.println("Input price of item 3:");
- priceThree = scan.nextDouble();
- System.out.println("");
- System.out.println("Your bill:");
- System.out.println("");
- System.out.print("Item %30");
- System.out.print("Price %10");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement