Question: C# Use methods to implement a modularized menu-driven program that allows a user to answer math questions on addition, subtraction, multiplication, and division. Here is

C# Use methods to implement a modularized menu-driven program that allows a user to answer math questions on addition, subtraction, multiplication, and division. Here is a sample run:

C# Use methods to implement a modularized menu-driven program that allows a

user to answer math questions on addition, subtraction, multiplication, and division. Here

Implement the methods specified below as described by the XML documentation comments for each method. You do not need to re-enter the XML documentation comments.

///

/// Prompt and return a valid int value entered by the user.

///

/// Message to write to the screen

/// int value entered by the user

static int PromptForIntegerValue(string prompt)

///

/// Prompt and return a valid double value entered by the user.

///

/// Message to write to the screen

/// double value entered by the user

static double PromptForDoubleValue(string prompt)

///

/// Writes a message to the screen indicating if the user answer is correct or incorrect

/// and return a boolean flag indicating if the user answer is correct.

///

/// The correct answer to the question

/// The user answer to the question

/// A boolean flag indicating if the user answer matches the correct answer

static bool CheckAnswer(double correctAnswer, double userAnswer)

///

/// Generates two random random numbers between minValue and maxValue,

/// calculate the correct answer to the addition question,

/// prompt the user for their answer to the addition question,

/// then returns the results of calling the CheckAnswer method.

///

/// The object to use for generating random numbers

/// The minimum value for the generated number

/// The maximum value for the generated number

/// The result of calling the CheckAnswer method

static bool AskAdditionQuestion(Random rand, int minValue, int maxValue)

///

/// Generates two random numbers between minValue and maxValue,

/// swap the two randomers if the first number is less than the second number,

/// calculate the correct answer to the subtraction question,

/// prompt the user for their answer to the subtraction question,

/// then returns the result of calling the CheckAnswer method.

///

/// The object to use for generating random numbers

/// The minimum value for the generated number

/// The maximum value for the generated number

/// The result of calling the CheckAnswer method

static bool AskSubtractionQuestion(Random rand, int minValue, int maxValue)

///

/// Generates two random numbers between minValue and maxValue

/// calculate the correct answer to the multiplication question,

/// prompt the user for their answer to the multiplication question,

/// then returns the result of calling the CheckAnswer method.

///

/// The object to use for generating random numbers

/// The minimum value for the generated number

/// The maximum value for the generated number

/// The result of calling the CheckAnswer method

static bool AskMultiplicationQuestion(Random rand, int minValue, int maxValue)

//

/// Generates two random numbers between minValue and maxValue

/// calculate the correct answer to the division question rounded to 1 decimal place,

/// prompt the user for their answer to the division question,

/// then returns the result of calling the CheckAnswer method.

///

/// The object to use for generating random numbers

/// The minimum value for the generated number

/// The maximum value for the generated number

/// The result of calling the CheckAnswer method

static bool AskDivisionQuestion(Random rand, int minValue, int maxValue)

///

/// Write the menu choices to the screen.

///

static void DisplayMenuChoices()

///

/// Prompt and return a valid menu choice.

///

/// a valid menu choice (a,s,m,d,v,e)

static char PromptForMenuChoice()

Math Quiz a) Addition Question s) Subtraction Question m) Multiplication Question d) Division Question- v) View Quiz Results- e) Exit Program Enter a letter for your choice:- You have not answered any questions yet. - ve Math Quiz- a) Addition Question s) Subtraction Question m) Multiplication Question d) Division Question v) view Quiz Results e) Exit Program Enter a letter for your choice: a What is 61 + 6 = ? I do not know. Why don't you tell me the answer? Invalid input! You must enter an integer value for the answer. 67- Correct! Math Quiz- a) Addition Questione s) Subtraction Question m) Multiplication Question d) Division Question v) View Quiz Results e) Exit Program Enter a letter for your choice: s- what is 47 - 33 = ? Incorrect! The correct answer is 14.4 Math Quiz a) Addition Question s) Subtraction Question m) Multiplication Question- d) Division Question- v) view Quiz Results e) Exit Program Enter a letter for your choice:- me what is 3 * 4 = ? 12 Correct! Math Quiz a) Addition Question- s) Subtraction Question m) Multiplication Question d) Division Questions v) view Quiz Results e) Exit Program Enter a letter for your choice:- d- What is 10 / 3 = ? (rounded to 1 decimal place) 3.3333334 Incorrect! The correct answer is 3.3.4 Math Quize a) Addition Question s) Subtraction Question m) Multiplication Question d) Division Question v) view Quiz Results e) Exit Program Enter a letter for your choice: ve Your current score is 50% (2/4). - Math Quiz a) Addition Question s) Subtraction Question- m) Multiplication Question d) Division Question- v) View Quiz Results- x) Exit Program Enter a letter for your choice: Invalid input value. Try again. # es Goodbye and thanks for playing

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!