100%(2)2 out of 2 people found this document helpful
This preview shows page 1 - 4 out of 16 pages.
COM-204-OL01Professor06/2019Assignment 7Chapter 10Exercise 6A.Design a class named StockTransaction that holds a stock symbol (typically one tofour characters), stock name, and price per share. Include methods to set and getthe values for each data field. Create the class diagram and write the pseudocodethat defines the class.
Get answer to your question and much more
B.Design an application that declares twoStockTransactionobjects and sets anddisplays their values.Pseudocode:startDeclarations
Stock Transactions stock1Stock Transactions stock2stock1.setStockSymbol(“MON”)stock1.setStockName(“Inside Money”)stock1.setPricePerShare(243.56)stock2.setStockName(“Interest Money”)stock2.setPricePerShare(523.36)output “Stock 1 Details:”output “Stock Symbol : “, stock1.getStockSymbol()output “Stock Name : “, stock1.getStockName()output “Price per share : “, stock1.getPricePerShare()output “Stock 2 Details:”output “Stock Symbol : “, stock2.getStockSymbol()output “Stock Name : “, stock2.getStockName()output “Price per share : “, stock2.getPricePerShare()stopC.Design an application that declares an array of15StockTransactionobjects. Prompt theuser for data for each object, and then display all the values.Pseudocode:startDeclarationsnum SIZE=15StockTransaction stocks num subsub=0while substocks[sub]=getDetails()sub=sub+1endwhiledisplayAllDetails( stocks, SIZE)stoppublic static StockTransaction getDetails()DeclarationsStock Transactionsnum sharePricestring stockNamestring stockSymboloutput “Enter Stock Symbol…”input stockSymbolD.Design an application that declares an array of15StockTransactionobjects. Promptthe user for data for each object, and then pass the array to a method thatdetermines and displays the two stocks with the highest and lowest price per share.startDeclarations