05:19
0

Contoh Program penyeleksian kondisi (if ) pada C++
Program  Penentu Bonus Belanja
Semoga bermanfaat ^-^


#include <iostream>
#include <conio.h>
using namespace std;
int total_bayar;
main(){
cout<<"=========Sistem Penentu Bonus Belanja========"<<endl;
cout<<endl;
cout<<endl;
cout<<"Daftar Bonus yang Tersedia:"<<endl;
cout<<"1. Sendok"<<endl;
cout<<"2. Gelas"<<endl;
cout<<"3. Piring"<<endl;
cout<<endl;
cout<<"Masukan Total Bayar"<<endl;
cin>>total_bayar;
if (total_bayar < 50000){
cout<<"anda kurang beruntung,belanjanya kurang banyak"<<endl;
}
else
if ((total_bayar >= 50000) && (total_bayar <= 100000)){
cout<<"bonus sendok"<<endl;
}

else
if ((total_bayar > 100000 )&& (total_bayar <= 150000)){
cout<<"bonus gelas"<<endl;
}

else
if (total_bayar > 150000){
cout<<"bonus piring"<<endl;
}

return 0;
}

Hasil Run


Newer Post
Previous
This is the last post.

0 comments:

Post a Comment