The Stock Broker Problem The Good Deal Stock Broker needs a COBOL program that w
ID: 3680108 • Letter: T
Question
The Stock Broker Problem
The Good Deal Stock Broker needs a COBOL program that will print a report on the stocks purchased and sold by it's customers. The input records to the program will be pre-sorted by customer account number and stock symbol within the account. In other words all of a customer's records will be together and all of the stock in a customer acount will be together. The following is an example of some sorted input records:
ACCOUNT NAME STOCK PURCHASE SOLD
11111 JONES ABC $200 $210
11111 JONES ABC $220 $230
11111 JONES IBM $100 $110
11111 JONES IBM $120 $120
22222 ADAMS NBC $500 $400
The actual input records will contain the following data:
COLUMNS DATA
1-5 ACCOUNT NUMBER
6-15 CUSTOMER NAME
16-18 STOCK SYMBOL
19-23 AVERAGE PURCHASE PRICE
24-28 AVERAGE SELLING PRICE
29-35 SHARES PURCHASED
36-80 RESERVED
The printed report will contain the Customer's Name and the Stock purchased along with the average purchasing price and selling price. The profit will be caluclated by substracting the purchase price From the selling price. Even if the Customer has purchased the same stock several times, only one stock symbol is printed. The program must total the purchasing price and selling price of all the same stock purchased before calculating the profit. The output report will contain the following information:
STOCK REPORT
ACCOUNT CUSTOMER STOCK AVERAGE AVERAGE QUANTITY PROFIT
NUMBER NAME SYMBOL BUYING PRICE SELLING PRICE OR LOST
11111 JONES ABC $210 $220 1000 +$10,000
11111 JONES IBM $110 $115 2000 +$10,000
Explanation / Answer
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.