Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string bitch;
- string choice;
- //They should reverse that, too confusing...
- int main() {
- cout <<"Would you like FRACTIONS or BASIC?" <<endl;
- cin >>choice;
- if(choice=="BASIC") {
- int NUM1,NUM2;
- cout << "Enter an operation." << endl;
- cin >>bitch;
- cout << "Enter a number." << endl;
- cin >>NUM1;
- cout << "Enter another number." << endl;
- cin >>NUM2;
- //for fun...
- cout << "Calculating.." << endl;
- if(bitch=="+") {
- cout << NUM1+NUM2;
- }
- else if(bitch=="-") {
- cout <<NUM1-NUM2;
- }
- else if(bitch=="x"||"*") {
- cout <<NUM1*NUM2;
- }
- else if(bitch=="/"||"divide") {
- cout <<NUM1/NUM2;
- }
- cin >> bitch;
- }
- //It displays wrong values...
- else if(choice=="FRACTIONS") {
- string bitch2;
- cout <<"What operation are you doing?" <<endl;
- cin >>bitch2;
- int a,b,c,d;
- cout <<"Insert first Numerator" << endl;
- cin >>a;
- cout <<"Insert first Denominator" << endl;
- cin >>b;
- cout <<"Insert second Numerator" << endl;
- cin >>c;
- cout <<"Insert second Denominator" << endl;
- cin >>d;
- if(bitch2=="+") {
- cout <<d*a + b*c << "/" << b*d;
- }
- else if(bitch2=="-") {
- cout <<d*a - b*c << "/" << b*d;
- }
- else if(bitch2=="x"||"*") {
- cout <<d*a * b*c << "/" << b*d;
- }
- else if(bitch2=="/") {
- cout <<d*a / b*c << "/" << b*d;
- }
- cin >>bitch2;
- }
- }
Add Comment
Please, Sign In to add comment