• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Untitled a guest Nov 18th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #include <iostream>
2. #include <cstdlib>
3. #include <string>
4. #include <ctime>
5. #include <cstdio>
6. #include <random>
7. #include <set>
8. int main() {
9.
10.     int least = 1;
11.     int most = 20;
12.
13.     int userScore = 0;
14.     int A = 2;
15.     int B = 3;
16.     int C;
17.     int D;
18.     int targetNumber2 = rand();
19.     int targetNumber1 = rand() % most + least;
20.     int userChoice;
21.
22.     while (userScore < 10)
23.     {
24.         std::cout << "User's score is " << userScore << std::endl;
25.         // This "cout" statement is for preparing the user to answer one of the given question.
26.         std::cout << "Decide whether " << targetNumber1 << " is one of the multiples or is not a muliple at all " << std::endl;
27.         if (A = targetNumber1 % 2 == 0)
28.         {
29.             userScore = +1;
30.         }
31.         else
32.         {
33.             userScore = -1;
34.         }
35.         std::cout << "A. The number is a multiple of 2. " << std::endl;
36.         if (B = targetNumber1 % 3 == 0)
37.         {
38.             userScore = +1;
39.         }
40.         else
41.         {
42.             userScore = -1;
43.         }
44.         std::cout << "B. The number is a multiple of 3. " << std::endl;
45.         if ( C = (targetNumber1 % 2 == 0 && targetNumber1 % 3 == 0))
46.         {
47.             userScore = +1;
48.         }
49.         else
50.         {
51.             userScore = -1;
52.         }
53.         std::cout << "C. The number is a multiple of both 2 and 3. " << std::endl;
54.         if (D = (targetNumber1 == 1 &&  targetNumber1 == 5 && targetNumber1 == 7 && targetNumber1 == 11 &&  targetNumber1 == 13 && targetNumber1 == 17 && targetNumber1 & 19))
55.         {
56.             userScore = +1;
57.         }
58.         else
59.         {
60.             userScore = -1;
61.         }
62.         std::cout << "D. None of these are true. " << D << std::endl;
63.     }
64.
65.     return 0;
66. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?