Hello, I have to make program, but I’m a little (ok, totally) stuck.
Program has to make two random numbers (from 1 to 9) and a random function (+, -, *, /, %, ^). It have to make exercise (like 3+4=? Or 3^2) and ask user to enter answer. If answer is right, program has to say – “correct”, if not – “wrong”. Program has to make 10 exercises and rate user at the end. Like for 10 right answers – “10, you are good student’’ for 9 right answers – “9, try again”, for 8 answers – “8, try again” and so on.
I haven’t gotten past library adding and I totally have no idea, how to code this.
This is how far I've got:
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
#include <cmath>
#include<cstdlib> //needed to create random number
using namespace std;
int main()
{
int x;
int y;
char operation;
|
Yes, I'm ashamed of myself.