Purchase Solution

C program using functions, switch statements, if statements

Not what you're looking for?

Ask Custom Question

I have a hard time getting started. The program is to help a student learn multiplication. I have to use the rand function to produce two positive one-digit integers. The program should type a question such as:
How much is 6 times 7?

The student will then type the answer. The program will then check the answer . If it is correct, print one of the following messages:

Very Good!
Excellent!
Nice Work!
Keep up the good work!

And then ask another multiplication question. If the answer is wrong, print one of the following messages:

No. Please try again/
Wrong. Try once more.
Don't Give up.
No. Keep trying.
Then let the student try the same question again repeatedly, until the student gets it right.

I will have to come with two functions to print the messages. Write a function to print one of the messages when the correct answer is entered and a function to print one of the messages when it is the wrong answer..

Purchase this Solution

Solution Preview

The C code is as follows. It is also attached as a C file.

#include <stdio.h>
#include <stdlib.h>

/* Print message if the answer is correct */
void PrintCorrect()
{
msg[4]=[ "Very Good!",
"Excellent!",
"Nice Work!",
"Keep up the good work!"];
int ...

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C# variables and classes

This quiz contains questions about C# classes and variables.