Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. public class StockApp
  2. {
  3.  
  4.     public static void main(String[] args)
  5.     {
  6.         String StockName, BrokerName, BuyerName, pDate, sDate;
  7.         int pQuantity, sQuantity;
  8.         double pPrice, sPrice;
  9.        
  10.         Buyer Bob;
  11.    
  12.         Scanner keyboard = new Scanner(System.in);
  13.    
  14.         System.out.println("What is your name?");
  15.         BuyerName = keyboard.nextLine();
  16.         if(BuyerName == String)
  17.         {
  18.            
  19.         }
  20.        
  21.         System.out.println("What is your broker's name?");
  22.         BrokerName = keyboard.nextLine();
  23.  
  24.         System.out.println("What is the name of the stock you purchased.");
  25.         StockName = keyboard.nextLine();
  26.    
  27.         System.out.println("How many shares did you purchase?");
  28.         pQuantity = keyboard.nextInt();
  29.    
  30.         System.out.println("How much was each stock worth?");
  31.         pPrice = keyboard.nextDouble();
  32.        
  33.         keyboard.nextLine();
  34.    
  35.         System.out.println("When did you buy these shares?");
  36.         pDate = keyboard.nextLine();
  37.    
  38.         Bob = new Buyer(BuyerName, BrokerName);
  39.        
  40.         System.out.println("How many shares did you sell?");
  41.         sQuantity = keyboard.nextInt();
  42.    
  43.         System.out.println("How much was each stock worth?");
  44.         sPrice = keyboard.nextDouble();
  45.        
  46.         keyboard.nextLine();
  47.    
  48.         System.out.println("When did you sell the stock?");
  49.         sDate = keyboard.nextLine();
  50.         // Ask for stock purchase/sale information
  51.        
  52.         Bob.Broke.BuyStock(StockName, pDate, pPrice, pQuantity);
  53.         Bob.Broke.SellStock(sDate, sPrice, sQuantity);
  54.         Bob.Broke.printMonthlyReport(Bob);
  55.        
  56.     }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement