daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. string bitch;
  5. string choice;
  6. //They should reverse that, too confusing...
  7. int main() {
  8.     cout <<"Would you like FRACTIONS or BASIC?" <<endl;
  9.     cin >>choice;
  10.     if(choice=="BASIC") {
  11.         int NUM1,NUM2;
  12.         cout << "Enter an operation." << endl;
  13.         cin >>bitch;
  14.         cout << "Enter a number." << endl;
  15.         cin >>NUM1;
  16.         cout << "Enter another number." << endl;
  17.         cin >>NUM2;
  18.         //for fun...
  19.         cout << "Calculating.." << endl;
  20.         if(bitch=="+") {
  21.             cout << NUM1+NUM2; 
  22.         }
  23.         else if(bitch=="-") {
  24.             cout <<NUM1-NUM2;
  25.         }
  26.         else if(bitch=="x"||"*") {
  27.             cout <<NUM1*NUM2;
  28.         }
  29.         else if(bitch=="/"||"divide") {
  30.             cout <<NUM1/NUM2;
  31.         }
  32.         cin >> bitch;
  33.     }
  34.     //It displays wrong values...
  35.     else if(choice=="FRACTIONS") {
  36.         string bitch2;
  37.         cout <<"What operation are you doing?" <<endl;
  38.         cin >>bitch2;
  39.         int a,b,c,d;
  40.             cout <<"Insert first Numerator" << endl;
  41.             cin >>a;
  42.             cout <<"Insert first Denominator" << endl;
  43.             cin >>b;
  44.             cout <<"Insert second Numerator" << endl;
  45.             cin >>c;
  46.             cout <<"Insert second Denominator" << endl;
  47.             cin >>d;
  48.             if(bitch2=="+") {
  49.                 cout <<d*a + b*c << "/" << b*d;
  50.                 }
  51.             else if(bitch2=="-") {
  52.                 cout <<d*a - b*c << "/" << b*d;
  53.                 }
  54.             else if(bitch2=="x"||"*") {
  55.                 cout <<d*a * b*c << "/" << b*d;
  56.                 }
  57.             else if(bitch2=="/") {
  58.                 cout <<d*a / b*c << "/" << b*d;
  59.                 }
  60.             cin >>bitch2;
  61.     }
  62.  
  63. }
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
 
Top