Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Counter-Controlled Loops C# CPSC1012 In-Class Exercise #7-Winter 2019 Term CPSC1012 In-Class Exercise #7-Event-Controlled Loops Student Name Student Mark: /5 INSTRUCTIONS Complete the requirements of this
Counter-Controlled Loops
C#
CPSC1012 In-Class Exercise #7-Winter 2019 Term CPSC1012 In-Class Exercise #7-Event-Controlled Loops Student Name Student Mark: /5 INSTRUCTIONS Complete the requirements of this assignment on your own. When you have finished, write your name on the board to get your instructor to mark your assignment. You are encouraged to create a flowchart; without a flowchart your instructor may not provide any assistance Step 1: Create a program named CPSC1012-Ex07-YourName Step 2: In the Main() method, write the code that will do the following: .Ask the user to enter a price for a product or 999 to quit o The program will Determine if the entered price is the highest or lowest price Validate the entered price before entering another price; display some error message if the grade is invalid. All prices are between $1.00 and $50.00 Prompt the user to enter another price or 999 to quit " " o If there are valid marks: Calculate the average price Display the average, highest, and lowest prices " o o o Else, display some error message indicating the user entered no prices Prompt the user to redo the steps above or quit (999) You must demonstrate at least one while loop and one do loop in your solution. Sample Output Enter a price between $1. and $5 . 0 or 999 to quit: 999 lo prices entered ould you like to play again? Enter Y or N: y Enter a price between $1.ee and $5e-ee or 999 to quit: 1e Enter a price between $1.ee and $50.e0 or 999 to quit: -5 Invalid price entered! Enter a price between $1. and $5 . 00 or 999 to quit: 5 Enter a price between S1.ee and $5 . 00 or 999 to quit: 999 The average price is: $7.5e The highest price is: $1e.ee The lowest price is: $5.0 ould you like to play again? Enter Y or N: y Enter a price between $1.ee and $5-00 or 999 to quit: 25 Enter a price between $1.ee and $50 or 999 to quit: 35 Enter a price between $1. and $5 . 00 or 999 to quit: 45 Enter a price between $1.ee and $500 or 999 to quit: 999 The average price is: $35.8 The highest price is: $45.ee The lowest price is: $25.ee ould you like to play again? Enter Y or N: n Thank you..GoodbyeStep 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