int main(){
loop:
int a(0),b(0),c(0),pakai,ulang;
unsigned short int jum;
unsigned short int a_ban,b_ban,c_ban;
cout << "Ini Program jadinya Ujian Praktikum C++\n" << endl;
cout << "Input Pemakaian Air : ";cin >> pakai;
cout << endl;
if (pakai > 40){
a = 40;
pakai = pakai - 40;
if (pakai > 20){
b = 20;
pakai = pakai - 20;
if (pakai >= 1){
c = pakai;
}
else{}
}
else{
b = pakai;
}
}
else{
a = pakai;
}
a_ban = a*450;
b_ban = b*600;
c_ban = c*850;
cout << "Pemakaian\tHitung\t\t\tHarga" << endl;
cout << "=========\t==========\t\t========" << endl;
cout << a << "\t\ta x Rp.450\t\tRp." << a_ban << endl;
cout << b << "\t\tb x Rp.600\t\tRp." << b_ban << endl;
cout << c << "\t\tc x Rp.850\t\tRp." << c_ban << endl;
cout << "\t\t\t\t\t======== + "<< endl;
jum = a_ban + b_ban + c_ban;
cout << "Jumlah yg Harus Dibayar Adalah = \tRp." << jum << endl;
cout << "\n ~ AkiraToya17 ~ " << endl;
cout << " Have Fun" << endl << endl;
cout << " ^_^" << endl;
cout << "\nKekurangan Program Ini apabila pemakaianan lebih dari 101";
cout << "\nKarena Jangkauan Nilainya hanya sampai 65535 ...";
cout << "\n\n1.Restart Program";
cout << "\n0.Exit Program\n\n";
cout << "Ingin Menjalankan Program Sekali lagi ? >> "; cin >> ulang;
if (ulang){
goto loop;
}
else{
return 0;}
return 0;
}