Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to calculate the purchase price of shares of stock. Ask the user for the number of shares of stock ( as an
Write a program to calculate the purchase price of shares of stock. Ask the user for the number of shares of stock as an integer and the price per share of stock as a double Then calculate and display the amount of money it would take to purchase the stock. Have a blank line between the input and the output. Follow the steps in the Information Processing Cycle Input, Processing, and Output. Make sure the output dollar amount is formatted to decimal places, and don't forget the ending punctuation.
Have a blank line at the end of your program to separate the last line of output from your program from the "Press any key to continue and do this for all programs that you write.
Example Run #:
bold type is what is entered by the user
Enter the number of shares of stock:
Enter the dollar amount per share: $
The amount of money needed to purchase shares of stock at $ is $
The example run shows EXACTLY how your program input and output will look.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started