So, Im new to C++, just started my TAFE course (Technical and Further Education)
I have homework to do, and it is to create a command line program with a functional use; I chose a Celcius to Farenheit converter.
Here is my code, Im not entirely sure where im going wrong though...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <iostream.h>
#include <conio.h>
using namespace std;
int main()
{
cout << "Farenheit to ceclius:F=9/5C+32 Celcius to Farenheit: 9/5*C+32" <<std::endl;
system ("pause");
int X;
char Y;
cout<< "Enter Degrees Celcius/Farenheit";
cin>>X;
cout<< "Enter your choice (Celcius-Farenheit [D] Farenheit-Celcius [F]";
cin>>Y;
Switch(Choice);
}
{
Case 'F': cout<< "Farenheit-Celcius="<<9/5*X+32;
break;
Case 'D': cout<< "Celcius-Farenheit="<<X*9/5+32;
break;
Default: cout<< "Invalid Choice!";
getch ();
return 0;
}
|
Every time I try to compile the program (BTW I am using Dev-CPP 4.9)
I get these errors:
'Choice undeclared (First use of function)'
'switch undecalared (first use of function)'
There was also some problems to fo with an outdated header, but i know about that, i need the "iostream.h" because one of the functions doesnt wok with just "iostream"
I think I know whats wrong with string and Choice, Did i miss a library or something?
Also if there is any other blindingly obvious mistakes it would be duly noted if you told me :P
Thanks :P