Question: Stock Transaction Program Last month Kool Doode purchased some stock from Kaplack, Inc. Write a program that ask the user to input the followings: 1.

Stock Transaction Program Last month Kool Doode purchased some stock from Kaplack, Inc. Write a program that ask the user to input the followings:

1. The stock name

2. Number of shares Kool Doode bought

3. Stock purchase price

4. Stock selling price

5. Broker commission

displays the following paid for the stock.:

1. The amount of money Kool Doode paid for the stock (number of shares bought * purchase price)

2. The amount of commission Kool Doode paid his broker when he bought the stock. (Amount he paid for stocks * commission in percent)

3. The amount that Kool Doode sold the stock for. (number of shares * selling price)

4. The amount of commission Kool Doode paid his broker when he sold the stock. (Amount he sold shares * commission in percent)

5. Display the amount of money Kool Doode had left when he sold the stock and paid his broker (both times). If this amount is positive, then Kool Doode made a profit. If the amount is negative, then Kool Doode lost money. Profit/loss =(amount for sold stocks- commission) - (amount paid to buy stocks + commission)

Sample program run below, user input in blue. Perform 3 more test runs more times with different user input and its output. Check each output with calculator to verify your program runs correctly. Output must look exactly as shown below. Assume that the user will always enter the Stock Name as a string and not anything else. The output amount for amount paid and amount sold will not exceed 9,999,999.99

Amount paid for the stock: $ 339,200.00

Commission paid on the purchase: $ 13,568.00

Amount the stock sold for: $ 359,200.00

Commission paid on the sale: $ 14,368.00

Profit (or loss if negative): $ -7,936.00

here are two sample test runs:

##Test Run 1

##Enter Stock name: Kaplack, Inc.

##Enter Number of shares : 10000

##Enter Purchase price : 33.92

##Enter selling price : 35.92

##Enter Commission : 0.04 ## ##

##Amount paid for the stock: $ 339,200.00

##Commission paid on the purchase: $ 13,568.00

##Amount the stock sold for: $ 359,200.00

##Commission paid on the sale: $ 14,368.00

##Profit (or loss if negative): $ -7,936.00

##Test Run 2

##Enter Stock name: IBM

##Enter Number of shares : 15000

##Enter Purchase price : 50.25

##Enter selling price : 100.20

##Enter Commission : 0.02

## ##

##Amount paid for the stock: $ 753,750.00

##Commission paid on the purchase: $ 15,075.00

##Amount the stock sold for: $ 1,503,000.00

##Commission paid on the sale: $ 30,060.00

##Profit (or loss if negative): $ 704,115.00

##

##Test Run 3

##Run the program again and enter different user value and paste it here

##

##Test Run 4

##Run the program again and enter different user value and paste it here

##

##Test Run 5

##Run the program again and enter different user value and paste it here

8.5.7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!