Calculate the Temperature

#include <iostream.h>
#include <conio.h>
class suhu {
friend istream& operator>>(istream&, suhu&);
public:
suhu() {};
void bandingkan() {
cout<<“kelilingcelcius = reamur : “<<4/5.0*x<<endl;
cout<<“celcius = fahrenheit : “<<9/5.0*x+32<<endl;
cout<<“celcius = kelvin : “<<x+273<<endl;
}
private:
int x;
};
istream& operator>>(istream& in, suhu& bilangan){
cout << “masukan suhu derajat celcius = “;
in >> bilangan.x;
return in;
};
main() {
suhu bilangan;
cin >> bilangan;
bilangan.bandingkan();
getch();
return 0;
}

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s