Advertisement
Guest User

7

a guest
Oct 25th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.03 KB | None | 0 0
  1. //Program flow for Computers.java that allows the user to select what they want to buy
  2. //Also offers the user some upgrade options for their computer/tablet of their choosing.
  3. //
  4. //
  5. //Author:Dexter Rogers
  6. //Date Created:10/24/16
  7.  
  8.  
  9. import java.util.ArrayList;
  10. import java.util.Scanner;
  11.  
  12. public class MCC_Rogers
  13. {
  14.   private final double fTaxRate = .07;  //tax rate that will be used in the main method
  15.  
  16.   public static void main(String [ ] args)
  17.  {
  18.      Computers tempComputer = new Computer("Laptop","Dell","Inspiron:Signature Edition","500gb","4gb");
  19.      Computer(listOfComputers.add(tempComputer);    
  20.      Computers tempComputer = new Computer("Laptop","Dell","Inspiron:2 in 1","500gb","4gb");
  21.      Computer(listOfComputers.add(tempComputer);
  22.      Computers tempComputer = new Computer("Laptop","Acer","Model:70VM","1tb","16gb");
  23.      Computer(listOfComputers.add(tempComputer);        
  24.      Computers tempComputer = new Computer("Laptop","Acer","Model:70XR","1tb","16gb");        
  25.      Computer(listOfComputers.add(tempComputer);        
  26.              
  27.      Tablets tempTablet = new Tablet("Tablet","Microsoft","Surface Pro 3","64gb","2gb");
  28.      Tablet(listOfTablets.add(tempTablet);
  29.      Tablets tempTablet = new Tablet("Tablet","Microsoft","Surface Pro 4","128gb","4gb");
  30.      Tablet(listOfTablets.add(tempTablet);
  31.              
  32.              
  33.      ArrayList<String> listOfComputers = new ArrayList<String>();
  34.      listOfComputers.add("15in Dell Inspirion:Signature Edition");
  35.      listOfComputers.add("15in Dell Inspirion:2 in 1");
  36.      listOfComputers.add("15in Acer:70VM");
  37.      listOfComputers.add("15in Acer:70XR");
  38.    
  39.      ArrayList<String> listOfTablets = new ArrayList<String>();
  40.      listOfTablets.add("Surface Pro 3");
  41.      listOfTablets.add("Surface Pro 4");
  42.      
  43.      ArrayList<Computers> listOfComputers = new ArrayList<Computers>();
  44.      listOfComputers.add("Laptop","Dell","Inspiron:Signature Edition","500gb","4gb");
  45.      listOfComputers.add("Laptop","Dell","Inspiron:2 in 1","500gb","4gb");
  46.      listOfComputers.add("Laptop","Acer","Model:70VM","1tb","16gb");
  47.      listOfComputers.add("Laptop","Acer","Model:70XR","1tb","16gb");
  48.                          
  49.      ArrayList<Tablets> listOfTablets = new ArrayList<Tablets>();
  50.      listOfTablets.add("Tablet","Microsoft","Surface Pro 3","64gb","2gb");                    
  51.      listOfTablets.add("Tablet","Microsoft","Surface Pro 4","128gb","4gb");
  52.                          
  53.                            
  54.                            
  55. //The program starts here.  Let's greet the user.
  56.     Scanner scan = new Scanner(System.in);
  57.     System.out.println("Hello, fair electronic buyer."); // Our app has a gretter, just like WalMart
  58.    
  59.       //Task 1: Ask the user if they want a laptop or tablet.
  60.     System.out.println("Would you like to buy a laptop or a computer?");
  61.     String customer_want = scan.next();
  62.    
  63.    
  64.    
  65. // If they want a tablet, show them the tablet options, otherwise show them a list of laptop options so they can choose 1 (or none)
  66.  
  67.   }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement