Case study program involved generating tests

Assignment Help Basic Computer Science
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).

Reference no: EM13934717

Questions Cloud

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.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd