Create a program that allows the user to enter the closing price of a specific stock for any number of days. Use a negative number as the sentinel value. If the sentinel value is the first price the...

Create a program that allows the user to enter the closing price of a specific stock for any number of days. Use a negative number as the sentinel value. If the sentinel value is the first price the user enters, display the “No stock prices entered” message on the screen. Otherwise, use a counter to keep track of the number of prices entered and an accumulator to total the prices. When the user has finished entering the prices, calculate the average price by dividing the accumulator’s value by the counter’s value, and then display the average price on the screen. Given the flowchart, create the equivalent program.start<br>number of<br>prices = 0<br>total prices = 0<br>enter price<br>F<br>price >=<br>Fnumber of<br>prices > 0<br>add 1 to the<br>number of prices<br>add price to total<br>prices<br>display

Extracted text: start number of prices = 0 total prices = 0 enter price F price >= Fnumber of prices > 0 add 1 to the number of prices add price to total prices display "No stock prices entered" average price = total prices / number of prices enter price /display average price stop

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here