Create two variables ttlproblems

Assignment Help Basic Computer Science
Reference no: EM132494150

For this project, you will make a program that will test the user's proficiency at solving different types of math problems. The program will be menu driven. The user will select either addition, subtraction, multiplication or division problems. The program will then display a problem, prompt the user for an answer and then check the answer displaying an appropriate message to the user whether their answer was correct or incorrect. The user will be allowed 3 tries at each problem. The program will also keep statistics on how many problems were answered correctly.

At this point you should have a working copy of the program that displays practice programs for addition, subtraction, multiplication and division.

This week you will add functions to allow the user to select problems of varying degrees of difficulty and also keep statistics on number of correct answers vs. total number of problems attempted.

So now let's add the code for the remaining functions:

We'll start by inserting code to ask the user if they want to see problems that are easy, medium or difficult. prompting them to enter 'e' for easy, 'm' for medium or 'd' for difficult and we'll this is right after they have selected the type of problems they want. We will also add a validation loop that will check to see if they entered a correct response (e,m, or d).

Easy - problems using numbers 0 thru 10
Medium - problems 11 thru 100
Difficult - problems 100 - 1000

Here's some code to get you started on the "difficulty level."
if( difficultyLevel == 'E')
{
num1=rand()%10+1;
num2=rand()%10+1;
}
else
if (difficultyLevel == 'M')
{num1=rand()%100+1;
num2=rand()%100+1;
}
else
{ num1=rand()%1000+1;
num2=rand()%1000+1;}

Use an "if" statement to check the difficulty and generate the random numbers.

Statistics:

Create two variables ttlProblems and correctAnswers. Every time the user answers a problem add 1 to ttlProblems and every correct answer add 1 to correctAnswers. We'll display the total number of problems and correct answers as well as the percent correct after the user has selected the exit option on the main menu.

Reference no: EM132494150

Questions Cloud

What is the error in total net income : A company's financial statement, What is the error in total net income for the combined three-year period resulting from the inventory errors?
What is the difference between emulation : 1. What Is The Difference Between Emulation, Native Virtualization, And Para Virtualization?
Take a new record from the user for a new student : Add a new record - take a new record from the user for a new student. Be careful, you may need to allocate more memory using dynamic memory allocation.
Draw the heap that results from inserting : Draw the heap that results from inserting 10, 12, 1, 14, 3, 17, 7, 2, 5, 8, 6 and 70 (in that order) into an initially empty binary max heap.
Create two variables ttlproblems : For this project, you will make a program that will test the user's proficiency at solving different types of math problems. The program will be menu driven.
Can anyone explain me the topic of linked lists : Can anyone explain me the topic of Linked Lists? I am studying data structures using Java and I need help wrapping myself around this concept.
Research on the topic of data analytics and visualization : Project assignment is to have you do more research on the topic of Data Analytics and Visualization. In this project you will need to do some research.
Prepare an answer sheet with the column headings : Agler Company specializes in manufacturing motorcycle helmets. Prepare an answer sheet with the following column headings
Which the land should be recorded in the purchaser books : Recognized by the purchaser as easily being worth $140,000, and is purchased for $137,000, the land should be recorded in the purchaser's books at

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is the irr of project

If a project has an initial outlay of $35,000 and cash flows of $14,000 per year for the next 5 years, what is the IRR of this project?

  What are some options available

What are some options available when backing up files with Windows Server 2012?

  Implement a program to count the frequencyofwords

Implement a program to count the frequencyofwords in a text file. Thetext file is partitioned intoNsegments. Each segment is processed by a separate thread that outputs the intermediate frequencycount for its segment. The main process waits un..

  Find criminal case that involved digital forensics

Find a criminal case that involved Digital Forensics. describing the case and the how digital forensics were used in the investigation.

  Current commenting within the project needs improvement

Identify the methods within the example program you believe are not sufficiently documented. Examine the control flow statements to determine what they do and if their purpose is clearly documented. Explain why you feel the current commenting within ..

  Role it innovation should play in company strategic plan

Discuss what role IT innovation should play in a company's strategic plan, and why?

  Describe the steps of algorithm for object database design

Design an 00 schema for a database application that you are interested in. First construct an EER schema for the application; then create the corresponding classes in ODL. Specify a number of methods for each class, and then specify queries in OQL..

  Democratizing purpose or an indoctrinating one

Does mass media serve a democratizing purpose or an indoctrinating one? Or both? Explain your answer fully with specific examples.

  Economists believe that persistent increases

Economists believe that persistent increases in the money supply increase inflation and do not affect the long-term growth rate of the economy. Why?

  What caused the cyberattack

CyberSecurity and Risk Management. What caused the cyberattack? Do not repeat an example that has been posted previously.

  What does statistically significant mean in this context

Explain in statistical terms why you might be skeptical about Dr. Weeks's conclusion. Propose an alternative explanation for these results.

  Manager for herman miller-a major manufacturer

You are a manager for Herman Miller-a major manufacturer of office furniture. You recently hired an economist to work with engineering and operations experts

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