#include <iostream.h>
#include <conio.h>
class suhu
{ int *c, *f, *r;
public :
suhu (int,int,int);
~suhu ();
int fahrent (void) {return ((*c * 1.8) + 32);}
int reamour (void) {return (*c * 0.8);}
int refah (void) {return ((*r * 2.25) + 32);}
int fahcel (void) {return ((*f / 1.8) - 32);}
};
suhu::suhu (int g, int h, int i){
c = new int;
f = new int;
r = new int;
*c = g;
*f = h;
*r = i;
}
suhu::~suhu (){
delete c;
delete f;
delete r;
}
int main(){
int c, f, r;
cout << "Masukan untuk derajat Celcius = "; cin>> c;
cout << "Masukan untuk derajat Reamour = "; cin>> r;
cout << "Masukan untuk derajat Fahrenheit = "; cin>> f;
suhu hsl(c,f,r);
cout <<"\nHasil Celcius ke Fahrenheit =" <<hsl.fahrent();
cout <<"\nHasil Celcius ke Reamour =" <<hsl.reamour();
cout <<"\nHasil Reamour ke Fahrenheit =" <<hsl.refah();
cout <<"\nHasil Fahrenheit ke Celcius =" <<hsl.fahcel();
getch();
return 0;
}
------------------------------------------------------------
semoga bermanfaat
0 komentar:
Posting Komentar