Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Konversi suhu
1. #include<iostream>
using namespace std;
int main()
{
int suhu;
float C,R,F,K;
char ulang;
do
{
cout<<"==============================n";
cout<<"
KONVERSI SUHUn";
cout<<"==============================n";
cout<<"1. C-Celciusn";
cout<<"2. R-Reamurn";
cout<<"3. F-Fahrenheitn";
cout<<"4. K-Kelvinn";
cout<<"Silakan Pilih Suhu: ";cin>>suhu;
switch(suhu)
{
case 1:
cout<<"==============================n";
cout<<"
Celciusn";
2. cout<<"==============================n";
cout<<"Masukkan derajat suhu= ";cin>>C;
R=C*0.8;
cout<<"Besar suhu Celcius ke Reamur adalah= "<<R<<endl;
F=(C*1.8)+32;
cout<<"Besar suhu Celcius ke Fahrenheit adalah= "<<F<<endl;
K=C+273.15;
cout<<"Besar suhu Celcius ke Kelvin adalah= "<<K<<endl;
break;
case 2:
cout<<"==============================n";
cout<<"
Reamurn";
cout<<"==============================n";
cout<<"Masukkan derajat suhu= ";cin>>R;
C=R/0.8;
cout<<"Besar suhu Reamur ke Celcius adalah= "<<C<<endl;
F=R*2.25+32;
cout<<"Besar suhu Reamur ke Fahrenheit adalah= "<<F<<endl;
K=R/0.8+273.15;
cout<<"Besar suhu Reamur ke Kelvin adalah= "<<K<<endl;
break;
case 3:
cout<<"==============================n";
cout<<"
Fahrenheitn";
cout<<"==============================n";
3. cout<<"Masukkan derajat suhu= ";cin>>F;
C=(F-32)/1.8;
cout<<"Besar suhu Fahrenheit ke Celcius adalah= "<<C<<endl;
R=(F-32)/2.25;
cout<<"Besar suhu Fahrenheit ke Reamur adalah= "<<R<<endl;
K=(F-32)/1.8+273.15;
cout<<"Besar suhu Reamur ke Kelvin adalah= "<<K<<endl;
break;
case 4:
cout<<"==============================n";
cout<<"
Kelvinn";
cout<<"==============================n";
cout<<"Masukkan derajat suhu= ";cin>>K;
C=K-273.15;
cout<<"Besar suhu Kelvin ke Celcius adalah= "<<C<<endl;
R=(K-273.15)*0.8;
cout<<"Besar suhu Kelvin ke Reamur adalah= "<<R<<endl;
F=K*1.8-459.67;
cout<<"Besar suhu Kelvin ke Fahrenheit adalah= "<<F<<endl;
}
cout<<"==============================n";
cout<<"==============================n";
cout<<"Apakah anda ingin mengulang y/n?: ";cin>>ulang;
}while(ulang=='y');
}