❓ [HELP]non-hack related c++

Posts 16–20 of 20 · Page 2 of 2
l.m.a.o.
/tooshort
this
cout << "I'm your calculater, how may I help you?" << endl;"

wasnt even in the code..
Cause I keep trying and I forgot that I took it out and yeaaah sorry
just do cin after cout and it will pause and wait for the enter key... shit I don't even know C++ and it makes sense
oh come on he is just learning
use: _getch(); from conio.h

Edit: i've written the entire code for ya:

Code:
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;

class Calc {	public:
				double numb1,
					   numb2;
					   
				char operatore;
};

int main() 
{
Calc tri;

cout<<"Press any key to start the Calculator :)"<<endl;
_getch();

system("cls");
cout<<"Insert the first number: ";
cin>>tri.numb1;


cout<<"\n\nInsert the second number: ";
cin>>tri.numb2;

cout<<"\n\nInsert the operator: ";
cin>>tri.operatore;

cout<<endl<<endl<<endl;

switch(tri.operatore){	case '+': cout<<tri.numb1<<" + "<<tri.numb2<<" = "<<tri.numb1+tri.numb2<<endl; break;
						case '-': cout<<tri.numb1<<" - "<<tri.numb2<<" = "<<tri.numb1-tri.numb2<<endl; break;
						case '/': cout<<tri.numb1<<" / "<<tri.numb2<<" = "<<tri.numb1/tri.numb2<<endl; break;
						case '*': cout<<tri.numb1<<" * "<<tri.numb2<<" = "<<tri.numb1*tri.numb2<<endl; break;
						default: cout<<"You may have entered an incurrect operator :p"<<endl;
}


_getch();
return 0;
}
Posts 16–20 of 20 · Page 2 of 2

Post a Reply

Tags for this Thread

None

Talk with us