Question: Description: Create a C# project and write code that creates a game for the user. Purpose: In this project you will develop a program and

Description: Create a C# project and write code that creates a game for the user.
Purpose: In this project you will develop a program and gain more skill using basic programming structures such as loops (for loop and while loop), decision structures, user defined functions, and organizing your code to create a game that asks questions to the user based on the requirements below.
Requirements:
Project Name: MathGame
Create a program in C# called MathGame that implements the requirements below.
Program Requirements
Your program should meet the following requirements:
1. Welcome and Name:
Prompt the user and ask them to enter their name.
If the user doesn't enter a name, ask them to try again.
2. Choose Your Challenge:
Ask the user to select their desired difficulty level (1,2, or 3).
If the user enters an invalid option, output an error message showing the valid options and ask them to try again.
3. Set the Question Limit:
Ask the user how many math problems they want to answer. Valid options (3-10).
If the user enters an invalid number, output an error message showing the valid range and ask them to try again.
4. Ask the Questions:
Present each problem to the user in the format X + Y =.
Generate the specified number of math problems based on the chosen question limit. The numbers in the problem (X and Y ) should have the chosen difficulty number of digits:
Level 1: Single-digit numbers (1-9)
Level 2: Double-digit numbers (10-99)
Level 3: Triple-digit numbers (100-999)
Get the user's answer.
5. Evaluate the Answer:
If the answer is correct:
Output: YaY! You Got It Right!!!
Move on to the next problem.
If the answer is incorrect (or not even a number):
Output: OOPS! You Got it WRONG!!!
The user is allowed a maximum of three (3) attempts per question to give a correct answer.
If the user does not give the correct answer after three tries, output the correct answer.
Move on to the next problem.
6. Final Score:
Once all problems are answered, congratulate the user on their effort.
Calculate and display their percentage of correct answers with two decimal places.
7. End the program

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 Programming Questions!