subject

How do i set up a remainder for my program? (C++) Details: i’m trying to set up a program meant for a child and i want a division problem to show remainders. I’ve tried but have no idea how.

Program:
#include
#include
#include
Int main() {

const int MIN_NUM = 1,
MAX_NUM = 99;

int randNum1,
randNum2;

Unsigned seed = time(0);
srand(seed);

randNum1 = (rand()%(MAX_NUM - MIN_NUM + 1) + MIN_NUM);

randNum2 = (rand()%(MAX_NUM - MIN_NUM + 1) + MIN_NUM);

case 'D':
case 'd': {
cout << "\nCool! \nLemme set you up with some DIVISION problems! " << endl;

cout << "\n";
cout << "\n";
cout << "\n " << randNum2 << "\n÷ " << randNum4 << "\n \n";

randNumAnswer = randNum2 / randNum4;

cin >> userAnswer;

if (userAnswer != randNumAnswer) {cout << "\nYou didn't get the right answer but try again. Don't lose hope!\n"; }

else if (userAnswer == randNumAnswer) { cout << "\nAmazing!! You did great!\n";}
break;}
}

return 0;
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:00, Dvrsug8598
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, ladawnrowles005
The option enables you to modify a slide element in most presentation applications.
Answers: 2
image
Computers and Technology, 23.06.2019 21:40, gaby06
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
image
Computers and Technology, 23.06.2019 23:40, lexiecooley
4. what is the reason for including the following code snippet in the header file animal. h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
You know the right answer?
How do i set up a remainder for my program? (C++) Details: i’m trying to set up a program meant for...

Questions in other subjects:

Konu
Chemistry, 21.04.2021 06:20
Konu
Mathematics, 21.04.2021 06:20
Konu
Mathematics, 21.04.2021 06:20