need help


Develop and run a C++ program to perform the following:
A. Present the user with a menu to select one of the following options:
1. Convert from Celsius to Fahrenheit
2. Convert from Fahrenheit to Celsius
3. Convert from pounds to kilograms
4. Convert from kilograms to pounds
9. EXIT */


#include <cmath>
#include <iostream>

using namespace std;
int main(void)

{
float Celsius;
float Fahrenheit;
float a;
float lb;
float Kilogram;
int N;

cout << "Hello. Welcome to the Temperature Conversion program" << endl;
cout << "Enter any option"<<endl;
cout << "1.Convert from Celsius to Fahrenheit" <<endl;
cout << "2.Convert from Fahrenheit to Celsius" <<endl;
cout << "3.Convert from pounds to kilograms" <<endl;
cout << "4.Convert from kilograms to pounds" <<endl;
cin >> a;

do

cout << "Please enter the degrees in Celsius and press ENTER: " << endl;
cin >> Celsius;
Fahrenheit = ((9.0/5)*Celsius) + 32;
cout << " Degrees Fahrenheit = " << Fahrenheit << endl;
cin>>N ;
while (N==1);
do

cout << "Please enter the degrees in Fahrenheit and press ENTER: " << endl;
cin >> Fahrenheit;
Celsius = (5.0/9) * (Fahrenheit - 32);
cout << " Degrees Celsius = " << Celsius << endl;

while (N==2)

do

cout << "Please enter the weight in pounds and press ENTER: " << endl;
cin >> lb;
Kilogram = 2.2 * lb;
cout << "Kilogram = " << Kilogram << endl ;

while(N=3)

do

cout <<"Please enter the weight in Kilograms and press ENTER: " << endl;
cin >> Kilogram;
lb=Kilogram\2.2;
cout << "Weight in Pounds = " << lb << endl;

while(N=4)

return 0;

}
on execution its giving me error
Lab Assignment 3.cpp(48): error C2061: syntax error : identifier 'cin'
y is anyone can help me fxing it
Wrap your code in [code][/code] tags
Say which line is 48
You are missing a lot of {}s. You need one after each do and before each while to indicate what is to be repeated.
Last edited on
Topic archived. No new replies allowed.