Reference no: EM13934717
You are required to design and implement a "Maths Test" program that generates simple maths questions, presents them one at a time to the user, and prompts them to enter the answer. The program determines whether the answer is correct and keeps track of data in order to present statistics and a grade to the user once a certain number of questions have been answered.
Despite the similar sounding theme, this program has very little in common with the case study in
Module 5. The case study program involved generating tests to be printed, while this assignment requires an interactive program that administers the test - prompting the user for an answer to each question it generates.
Implement all of the following requirements, and ask your tutor if you do not understand any of the requirements or would like further information. The requirements of the program are:
1. The program should welcome the user and prompt them to choose Easy, Medium or Hard:2. Re-prompt the user until a valid response (1, 2 or 3) is entered. Once a difficulty has been chosen, print a message to confirm the selected difficulty and set variables as follows:
- If "Easy" was chosen... lives = 3 and maxNum = 10
- If "Medium" was chosen... lives = 2 and maxNum = 25
- If "Hard" was chosen... lives = 1 and maxNum = 50
The lives variable determines how many questions the user can get wrong before the test ends, and the maxNum variable determines the biggest number that can be generated in a question. 3. The program should then enter a loop that will be used to ask 10 questions. The loop body code must generate and display a question, prompt for and check the answer, and display feedback:
3.1. Write a function named "generateQuestion" which requires a parameter of the maxNum variable. The function should generate two random numbers between 1 and maxNum, and then randomly choose between the addition ("+") or subtraction ("-") operator. Concatenate the numbers and operator into a string (e.g. "What is 20 + 25?") and also calculate the answer to the question (e.g. 45). The function should return both the question string and the answer (an integer).
A monopolist can produce its output at a constant average
: A monopolist can produce its output at a constant average and constant marginal cost of:ATC = MC = 5. The monopoly faces a demand curve given by the following function: Q= 53-P. And a marginal revenue curve that is given by the function:MR = 53 - 2Q...
|
Define process- food energy is converted in chemical energy
: Describe the process by which food energy is converted into the chemical energy of ATP in living cells. Go through each of the major steps in the process, including the starting and ending product of each step, and any important molecules produced..
|
Estimate the amount of manufacturing overhead
: Estimate the amount of manufacturing overhead that the company would save related to the reduction in machine hours. Why is the savings less than $20 per machine hour?
|
Amount to be paid-amount of interest and interest rate
: A car dealer will sell you the $16,450 car of your dreams for $4,329 down and payments of $339.97 per month for 48 months. a. Amount to be paid b. Amount of interest c. Interest rate d. APR (rounded to the nearest tenth percent)
|
Case study program involved generating tests
: You are required to design and implement a "Maths Test" program that generates simple maths questions, presents them one at a time to the user, and prompts them to enter the answer. The program determines whether the answer is correct and keeps tr..
|
Write a program that computes an average score for a class
: When the user presses the OK button, the items contents should update in the ListView control.
|
Identify potential implications for practice for nurses
: Identify the implications and make recommendations for nursing. Design a poster presentation in order to disseminate findings
|
Impact the company cost of capital
: If Exxon Mobil decided to take on a large, representing over 40% of their existing capital, project outside of their industry, how would this impact the company’s cost of capital for Exxon Specifically?
|
Just in time production systems seek to reduce the amount
: Just in time production systems seek to reduce the amount of material, work in process, and finished goods inventory.
|