menu search
brightness_auto
more_vert
Implement a class temperature to convert degree Fahrenheit value to degree Celsius value [Hint:  C/5 = F – 32 / 9 where C is temperature in degree Celsius and F is temperature in Fahrenheit) [March 2006, March 2009]
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
#include<iostream.h>
class convert
{private:
float C,F;
public:
void getdata();
void cal();
void display();
};

void convert::getdata()
{
cout<<"Enter temperature in centigrade ";
cin>>C;
}
void convert::cal()
{
F=1.8*C +32;
}
void convert::display()
{
cout<<"The temperature in Fahrenheit is : "<<F;
}

void main()
{
convert temperature;
temperature.getdata();
temperature.cal();
temperature.display();
}
 

Only for Turbo C++
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers

4.8k questions

4.3k answers

67 comments

388 users

...