SHARE
TWEET

Untitled

a guest Nov 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <cstdio>
  5. #include <random>
  6. #include <set>
  7. // These three "#include" statements are for the rand() code.
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <time.h>
  11. using namespace std;
  12. int main() {
  13.  
  14.     int least = 1;
  15.     int most = 20;
  16.     int userScore = 0;
  17.     int A;
  18.     int B;
  19.     int C;
  20.     int D;
  21.     int targetNumber1;
  22.     const int mostScore = 10;
  23.     int userChoice;
  24.     srand(time(NULL));
  25.     int i = 0;
  26.     while (userScore < 10)
  27.     {
  28.         cout << "Your score " << userScore << endl;
  29.         srand(time(NULL));
  30.         targetNumber1 = rand() % 20 + 1;
  31.         std::cout << "Decide whether " << targetNumber1 << " is one of the multiples or is not a muliple at all " << std::endl;
  32.         if (A = targetNumber1 % 2 == 0)
  33.         {
  34.             userScore += 1;
  35.         }
  36.         else
  37.         {
  38.             A = targetNumber1 % 2 == 1;
  39.             userScore -= 1;
  40.         }
  41.         std::cout << "A. The number is a multiple of 2. " << std::endl;
  42.         if (B = targetNumber1 % 3 == 0)
  43.         {
  44.             userScore += 1;
  45.         }
  46.         else
  47.         {
  48.             B = targetNumber1 % 3 == 1;
  49.             B = targetNumber1 % 3 == 2;
  50.             userScore -= 1;
  51.         }
  52.         std::cout << "B. The number is a multiple of 3. " << std::endl;
  53.         if (C = (targetNumber1 % 2 == 0 && targetNumber1 % 3 == 0))
  54.         {
  55.             userScore += 1;
  56.         }
  57.         else
  58.         {
  59.             A = targetNumber1 % 2 == 1;
  60.             B = targetNumber1 % 3 == 1;
  61.             B = targetNumber1 % 3 == 2;
  62.             userScore -= 1;
  63.         }
  64.         std::cout << "C. The number is a multiple of both 2 and 3. " << std::endl;
  65.         if (D = (targetNumber1 == 1 && targetNumber1 == 5 && targetNumber1 == 7 && targetNumber1 == 11 && targetNumber1 == 13 && targetNumber1 == 17 && targetNumber1 == 19 && targetNumber1 & 19))
  66.         {
  67.             userScore += 1;
  68.         }
  69.         else
  70.         {
  71.             D = targetNumber1 == 2;
  72.             D = targetNumber1 == 3;
  73.             D = targetNumber1 == 4;
  74.             D = targetNumber1 == 6;
  75.             D = targetNumber1 == 8;
  76.             D = targetNumber1 == 9;
  77.             D = targetNumber1 == 10;
  78.             D = targetNumber1 == 12;
  79.             D = targetNumber1 == 14;
  80.             D = targetNumber1 == 15;
  81.             D = targetNumber1 == 16;
  82.             D = targetNumber1 == 18;
  83.             D = targetNumber1 == 20;
  84.             userScore -= 1;
  85.         }
  86.         std::cout << "D. None of these are true. " << std::endl;
  87.         srand(time(NULL));
  88.         std::cin >> A;
  89.         std::cin >> B;
  90.         std::cin >> C;
  91.         std::cin >> D;
  92.         cout << "If you are correct, you get plus one score to your total, but if you are wrong, you see that your score is one point less than before" << endl;
  93.         system("pause");
  94.     }
  95.  
  96.     return 0;
  97. }
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. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top