Buatlah source code program menggunakan Teknik Pemrograman Terstruktur untuk
menentukan jenis pembayaran dan pembelian jenis rumah pada Perusahaan Property baik yang
diketahui secara fiktif ataupun nyata dalam lingkungan bisnis.
#include <iostream>
using namespace std;
int main()
{
char tiperumah, luasrumah;
int harga1, harga2;
cout << "properti tersedia" << endl;
cout << "model rumah:" << endl;
cout << "1. Rumah Kontemporer Rp10.000.000" << endl;
cout << "2. modern klasik italia Rp20.000.000" << endl;
cout << "3. American Classic Rp30.000.000\n" << endl;
cout << "luas properti: "<< endl;
cout << "1. tipe 1 Rp100.000.000" << endl;
cout << "2. tipe 2 Rp200.000.000" << endl;
cout << "3. tipe 3 Rp300.000.000" << endl;
cout << "silahkan pilih properti yang tersedia : ";
cin >> tiperumah;
switch (tiperumah) {
case '1':
cout << "anda memilih model Rumah Kontemporer" << endl;
harga1 = 10;
break;
case '2':
cout << "anda memilih model modern klasik italia" << endl;
harga1 = 20;
break;
case '3':
cout << "anda memilih model American Classic" << endl;
harga1 = 30;
break;
default:
cout << "tidak ada dalam list" << endl;
}
cout << "\nsilahkan pilih luas properti yang tersedia : ";
cin >> luasrumah;
switch (luasrumah) {
case '1':
cout << "anda memilih tipe 1" << endl;
harga2 = 100;
break;
case '2':
cout << "anda memilih tipe 2" << endl;
harga2 = 200;
break;
case '3':
cout << "anda memilih tipe 3" << endl;
harga2 = 300;
break;
default:
cout << "tidak ada dalam list" << endl;
}
cout << "\n========================" << endl;
cout << "total yang harus anda bayar : Rp " << harga1 + harga2; cout <<" juta"<<endl;
return 0;
}