PDA

View Full Version : Arrrrrggggg "c++"


WingWarp
07-16-2006, 09:11 PM
DOES ANY ONE KNOW HOW TO C++ PROGRAM IF YOU DO CAN U TELL ME WHATS WRONG!!!!

IT KEEPS RUNNING IN AN UNCONTROABLE LOOP IT IS SPOSTO BE A CACULATOR!:confused: :confused: :confused:

#include <iostream>
using namespace std;
int main()
{
int TIMES=1;
int X;
int Y;
int z;

while (TIMES == 1) {
cout<<"imput 1st number! \n";
cin>> X;
cout<<"imput your (/)(*)(-)(+)\n";
cin>> z;
cout<<"-"<< z << ":";
cin>> Y;
cout<<"="<<X << z << Y <<"\n";
int X=0;
int Y=0;
int z=0;
int reset=0;
cout<<"are you finished? { 1= NO} {0= YES}";
cin>> TIMES;
}
cin.get();
}

Maka
07-16-2006, 09:51 PM
I'll be able to help you after I finish my C++ course next year;)

WingWarp
07-16-2006, 10:07 PM
I'll be able to help you after I finish my C++ course next year;)

THX BUT I JUST WANTED TO FINISH IT TODAY!


get a head start

1.GET A FREE COMPILER FOR C++ BY BLOODSHED SOFTWARE.COM
2.WWW.CPROGRAMMING.COM!

THAT IS WHERE I LEARNED IT GOOD LUCK ON YOUR COURSE NEXT YEAR!:woop:

Webb
07-16-2006, 10:21 PM
Can we lose the caps lock ;) Signifies shouting online *hint hint* ;)

WingWarp
07-16-2006, 10:29 PM
Can we lose the caps lock ;) Signifies shouting online *hint hint* ;)

sorry............

Tron
07-17-2006, 12:26 PM
#include <iostream>
#include <iomanip>
using namespace std;

int main() {
int left, right; // Operands
char oper; // Operator
int result; // Resulting value

while (cin >> left >> oper >> right) {
switch (oper) {
case '+': result = left + right;
break;
case '-': result = left - right;
break;
case '*': result = left * right;
break;
case '/': result = left / right;
break;
default : cout << "Bad operator '" << oper << "'" << endl;
continue; // Start next loop iteration.
}
cout << result << endl << endl;
}

return 0;
}

P1NSEEKER
07-17-2006, 01:25 PM
Am i the only person wondering wtf c++ is?

bombgod
07-17-2006, 01:38 PM
C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for creating large-scale applications. C++ is a superset of the C language. A related programming language, Java, is based on C++ but optimized for the distribution of program objects in a network such as the Internet. Java is somewhat simpler and easier to learn than C++ and has characteristics that give it other advantages over C++. However, both languages require a considerable amount of study.
there you go

P1NSEEKER
07-17-2006, 01:52 PM
Still none the wiser but thanks ;) I'll go on assuming its magic!

DaveWilma07
07-17-2006, 07:52 PM
Am i the only person wondering wtf c++ is?

Its a programming language. I cant really programme. Found it very tough, even when tasked to produce a simple "hangman" game... :(