11 \/Program BI public class Stock { 2 3 4 15 private String stockCompany: private int unitShare; private double current

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

11 \/Program BI public class Stock { 2 3 4 15 private String stockCompany: private int unitShare; private double current

Post by answerhappygod »

11 Program Bi Public Class Stock 2 3 4 15 Private String Stockcompany Private Int Unitshare Private Double Current 1
11 Program Bi Public Class Stock 2 3 4 15 Private String Stockcompany Private Int Unitshare Private Double Current 1 (123.83 KiB) Viewed 31 times
11 Program Bi Public Class Stock 2 3 4 15 Private String Stockcompany Private Int Unitshare Private Double Current 2
11 Program Bi Public Class Stock 2 3 4 15 Private String Stockcompany Private Int Unitshare Private Double Current 2 (125.63 KiB) Viewed 31 times
11 \/Program BI public class Stock { 2 3 4 15 private String stockCompany: private int unitShare; private double currentPrice; private double brokerRate; 16 7 8 private double sstRate; 19 private double clearRate; ho public Stock) { lu 12 13 stockCompany = 5; unitShare=0; currentPrice=0.0; 14 15 brokerRate=0.0; 16 sstrate=0.0; 117 clearRate=0.0; 118 19 } public Stock(String stockCompany,int unitshare,double currentPrice, double brokerRate, double SSTRate, double clRate) { 20 21 22 =stockCompany; 23 FunitShare; 24 25 =currentPrice; 26 = brokerRate; 27 28 sstrate=SSTRate, clear Rate=clRate; 29 30 31

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply