Advertisement
ConnorSiebens

Furniture

Oct 30th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Furniture {
  3.         /**
  4.          *@ConnorSiebens
  5.          */
  6.     public static void main(String[] args) {
  7.         Scanner keyboard = new Scanner(System.in);
  8.         int wood,size,price=0;
  9.         System.out.println("Enter 1 for pine, 2 for oak, or 3 for mahogany.");
  10.         wood = keyboard.nextInt();
  11.         System.out.println("Enter 1 for large and 2 for small");
  12.         size = keyboard.nextInt();
  13.         if (wood == 1) {
  14.             if (size == 1) {
  15.                 price = 135;
  16.             } else if(size == 2) {
  17.                 price = 100;
  18.             }
  19.         }
  20.         if (wood == 2) {
  21.             if (size == 1) {
  22.                 price = 260;
  23.             } else if(size == 2) {
  24.                 price = 225;
  25.             }
  26.         }
  27.         if (wood == 3) {
  28.             if (size == 1) {
  29.                 price = 345;
  30.             } else if(size == 2) {
  31.                 price = 310;
  32.             }
  33.         }
  34.         System.out.println("The price of the table is $"+price);
  35.         keyboard.close();
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement