SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 02 Dec 2017 My Price 10.00

C program that randomly generates, conducts,

CSCI 2240

Program #1

Math Quiz

Your task is to write a C program that randomly generates, conducts, and scores a simple arithmetic quiz based on certain user parameters. The arithmetic quiz will ask questions dealing with simple addition, subtraction, multiplication, and division. The user will be asked to enter the number of questions for the quiz, between 1 and 20 (be sure to verify and re-prompt if necessary) and a difficulty level between 1 and 4 (also verify).

The difficulty will determine the range of numbers that are randomly generated for the questions:

 

Difficulty Range (all integers)

1 1 – 10

2 1 – 50

3 1 – 100

4 -100 – 100

 

So a quiz with a difficulty of three might have a problem like “75+4” but would not have a problem such as “-75+4”, since negative numbers are only included at difficulty level four.

 

Once these parameters are set, the quiz will begin, providing the user with simple arithmetic statements, where the operations (+, -, *, /) and operands are randomly generated using rand(). In the case of division, do not allow the second operand to be zero. Make sure the quiz is different every time!

 

For each question the user is prompted to enter their answer and will be told if they are correct or incorrect. There must be three correct and incorrect responses, and the one used will be randomly selected. If you take a look at the example below, you will see that “Nice!”, “Good job!” and “You’re right!” are the three randomly selected responses for correct answers, and there are three more for incorrect answers. If the user answered incorrectly, the program also prints the correct answer.

 

After all the questions are given and answered, the score is provided by stating the number of questions correct / number of questions asked.

 

For the most part how you write the program solution is up to you; however it must include at least these functions (feel free to add more):

 

genQuestion() – Used to randomly generate and output a random question based upon a difficulty which is passed as a parameter. Returns the answer of the question.

 

answerQuestion() – Prompts user for an answer, checks if it is correct based on the correct answer, which is passed to the function as a parameter. Returns an indicator of whether or not the answer was correct.

 

response() – Outputs a response to the user’s answer based upon a passed parameter which indicates whether the answer was correct or incorrect. The function randomly selects one of the three responses, either from the correct responses or the incorrect responses.

Attachments:

Answers

(5)
Status NEW Posted 02 Dec 2017 12:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)