Pages

Monday, 5 March 2018

Redo Exercise 2.11 using a CLASS called TEMP and member functions in C++ Programming Language.


Redo Exercise 2.11 using a CLASS called TEMP and member functions in C++ Programming Language.

/* Redo Exercise 2.11 using a CLASS called TEMP and
member functions.*/

#include
#include

class TEMP
{
float f,c;
public:
float getdata();
void display(void);
};

float TEMP :: getdata()
{
cout<<"Enter Value for farenheit degree to find for celsius:- ";
cin>>f;
c = (f-32)/1.8;
return(c);
}

void TEMP :: display(void)
{
float v;
v=getdata();
cout<<"CELSIUS DEGREE = "<}

void main()
{
TEMP c;
c.display();
}