11 \/Program BI public class Stock { 2 3 4 15 private String stockCompany: private int unitShare; private double current
Posted: Fri May 20, 2022 11:51 am
33 public String getStockCompany { 34 35 36 37 } 38 39 public double getCurrentPrice) { 40 141 42 } 43 44 45 public double getUnitShare(0) { 46 47 48 } 149 50 public double getBrokerRate() { 51 52 53 } 54 55 56 public double calcSellstockCost() { double brokerFees; 57 58 double shareAmount; 59 60 shareAmount= unitshare currentPrice; brokerFees = shareAmount brokerRate/100; 61 62 63 64 165 166 3 670
c. From line 5 - line 15 in Program B2, complete the static method named displayinfo() to display the information of each item object and its costs. Time left d. At line 20 - line 22 in Program B2, create two Stocks objects, stockl and stock2, and assign the values as shown in Figure 1. e. At line 24- line28 in Program B2, call a static method named displayinfo() that displays the information of each item object and its sum of the selling price earned by the investor. li 17/Program B2 2 3 public class TestStock{ 14 15 public static void displayinfo s) 16 { 7 18 System.out.println("\n\nShare to Sell:" + 19 + "nShare Amount to sell:" + + "\nCurrent Price: 10 + "\nBrokerage Rate:" + 12 + "\nTotal Selling Price:" + 13 14 115 } 16 17 public static void main(String[] args) { 18 119 20 수 21 22 23 수 24 25 26 27 28 29 30