- Apr 10, 2001
- 48,775
- 3
- 81
Originally posted by: Goosemaster
Originally posted by: sao123
#include<hell.h>
LOFL..I actually got that
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int celsius;
int fahrenheit;
int m;
int n;
cout << "WELCOME TO THE ULTRACONVERTOR 3000, YOUR SOURCE FOR TEMPERATURE CONVERSION" << endl;
cout << "FUFILLING ALL YOUR TEMPERATRUE NEED SINCE 1955" << endl;
cout << " WOULD YOU LIKE ME TO CONVERT TEMPERATURES TODAY?" << endl;
cout << " Press 1 to continue or 0 not to" << endl;
cin >> m;
if (m == 1)
cout << "great, let's get started!" << endl;
else
cout << " too bad." << endl;
system ("PAUSE");
}
Originally posted by: EvilYoda
Originally posted by: Goosemaster
Originally posted by: sao123
#include<hell.h>
LOFL..I actually got that
So you're not actually doing as badly as you let on
Originally posted by: EvilYoda
Well 'm' could be just a string, but depending on how detailed you want to get, you'll have to deal with error handling...you could type "YES" or "yes" or "Yes"...
Have fun
cout << " WOULD YOU LIKE ME TO CONVERT TEMPERATURES TODAY?" << endl;
string st;
cout << " TYPE YES TO CONTINUE OR NO NOT TO" << endl;
cin >> st;
switch ( st )
{
case YES:
cout << "great, let's get started!" << endl;
break;
case YEs:
cout << "great, let's get started!" << endl;
break
case YeS:
cout << "great, let's get started!" << endl;
break;
case Yes:
cout << "great, let's get started!" << endl;
break;
case yES:
cout << "great, let's get started!" << endl;
break;
case yEs:
cout << "great, let's get started!" << endl;
break;
case yeS:
cout << "great, let's get started!" << endl;
break;
}
else
cout << " too bad." << endl;
Originally posted by: Goosemaster
This is what I have now, but it doesn't work
cout << " WOULD YOU LIKE ME TO CONVERT TEMPERATURES TODAY?" << endl;
string st;
cout << " TYPE YES TO CONTINUE OR NO NOT TO" << endl;
cin >> st;
switch ( st )
{
case "YES":
cout << "great, let's get started!" << endl;
case "YEs":
cout << "great, let's get started!" << endl;
case "YeS":
cout << "great, let's get started!" << endl;
case "Yes":
cout << "great, let's get started!" << endl;
case "yES":
cout << "great, let's get started!" << endl;
case "yEs":
cout << "great, let's get started!" << endl;
case ''yeS":
cout << "great, let's get started!" << endl;
}
Originally posted by: WobbleWobble
cin a char and do a case statement for y, Y, n, N
Originally posted by: Goosemaster
ellaborate
<---proprieter of "Moron Mountain"
I tried decalring a char and it didn't work..that was like an hour agao
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
ellaborate
<---proprieter of "Moron Mountain"
I tried decalring a char and it didn't work..that was like an hour agao
Originally posted by: Goosemaster
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
ellaborate
<---proprieter of "Moron Mountain"
I tried decalring a char and it didn't work..that was like an hour agao
cool
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
ellaborate
<---proprieter of "Moron Mountain"
I tried decalring a char and it didn't work..that was like an hour agao
cool
Read my edit in case you missed it about getch()
Originally posted by: Goosemaster
I am not familar with getch
<--nooB
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
I am not familar with getch
<--nooB
I'm assuming you're starting a basic programming class. Just stick with cin or else your teacher might question the usage of getch() (like you're getting help from external sources )
#include <conio.h>
...
char m;
m = getch();
Originally posted by: Goosemaster
Originally posted by: WobbleWobble
Originally posted by: Goosemaster
I am not familar with getch
<--nooB
I'm assuming you're starting a basic programming class. Just stick with cin or else your teacher might question the usage of getch() (like you're getting help from external sources )
#include <conio.h>
...
char m;
m = getch();
thanks
this proggy..she is going to be a bute