// untuk pemrograman C++ nya kurang lebih seperti ini
//Mohon jika salah hehe :)
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
using namespace std;
int main ()
{
a: system("color 4e");
int pil;
int lagi;
float jumlah;
int bt=3000;
int pn=2000;
int pg=1500;
string pili;
cout<<"=============="<<"\n";
cout<<"Aplikasi Harga"<<"\n";
cout<<"Pilih angka "<<"\n";
cout << "1. Buku Tulis[BT]"<<"\n";
cout << "2. Pensil[PN]\n";
cout << "3. Penghapus[PG]\n";
cout << "masukan pilihan = " ; cin >> pil;
if (pil<=3 && pil>=1)
cout << endl;
cout<<"================"<<"\n";
cout<<"Keterangan Harga"<<"\n";
cout<<"Buku tulis = 3000 \nPena = 2000 \nPenghapus = 1500\n\n";
switch (pil)
case 1:
cout << "Anda Memilih Buku Tulis[BT]" << "\n";break;
case 2:
cout << "Anda Memilih Pensil[PN]" << "\n";break;
case 3:
cout << "Anda Memilih Pensil Penghapus[PG]" << "\n";break;
}
cout << "Jumlah Yang ingin dibeli :"; cin >> jumlah;
cout << "Jumlah : " << jumlah << "Harga =" << jumlah*bt << "\n\n";break;
cout << "Jumlah : " << jumlah<< " Harga =" << jumlah*pn << "\n\n";break;
cout << "Jumlah : " << jumlah<<" Harga =" << jumlah*pg << "\n\n";break;
cout<<"=========="<<"\n";
cout<<"==HASIL=="<<"\n";
switch(pil){
cout << "Nama barang yang dibeli Buku Tulis[BT] " << "\n"<<"Total Harga = "<<jumlah*bt<<"\n\n";break;
cout << "Nama barang yang dibeli Pensil[PN] " << "\n"<<"Total Harga = "<<jumlah*pn<<"\n\n";break;
cout << "Nama barang yang dibeli Penggaris[PG] " << "\n"<<"Total Harga = "<<jumlah*pg<<"\n\n";break;
else
cout << "Pilih Angka 1 sampai 3 Saja" << "\n\n\n";
cout << "Sekian Dan Terimakasih \n\n\n";
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
// untuk pemrograman C++ nya kurang lebih seperti ini
//Mohon jika salah hehe :)
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
using namespace std;
int main ()
{
a: system("color 4e");
int pil;
int lagi;
float jumlah;
int bt=3000;
int pn=2000;
int pg=1500;
string pili;
cout<<"=============="<<"\n";
cout<<"Aplikasi Harga"<<"\n";
cout<<"=============="<<"\n";
cout<<"Pilih angka "<<"\n";
cout << "1. Buku Tulis[BT]"<<"\n";
cout << "2. Pensil[PN]\n";
cout << "3. Penghapus[PG]\n";
cout << "masukan pilihan = " ; cin >> pil;
if (pil<=3 && pil>=1)
{
cout << endl;
cout<<"================"<<"\n";
cout<<"Keterangan Harga"<<"\n";
cout<<"================"<<"\n";
cout<<"Buku tulis = 3000 \nPena = 2000 \nPenghapus = 1500\n\n";
switch (pil)
{
case 1:
cout << "Anda Memilih Buku Tulis[BT]" << "\n";break;
case 2:
cout << "Anda Memilih Pensil[PN]" << "\n";break;
case 3:
cout << "Anda Memilih Pensil Penghapus[PG]" << "\n";break;
}
cout << "Jumlah Yang ingin dibeli :"; cin >> jumlah;
switch (pil)
{
case 1:
cout << "Jumlah : " << jumlah << "Harga =" << jumlah*bt << "\n\n";break;
case 2:
cout << "Jumlah : " << jumlah<< " Harga =" << jumlah*pn << "\n\n";break;
case 3:
cout << "Jumlah : " << jumlah<<" Harga =" << jumlah*pg << "\n\n";break;
}
cout<<"=========="<<"\n";
cout<<"==HASIL=="<<"\n";
cout<<"=========="<<"\n";
switch(pil){
case 1:
cout << "Nama barang yang dibeli Buku Tulis[BT] " << "\n"<<"Total Harga = "<<jumlah*bt<<"\n\n";break;
case 2:
cout << "Nama barang yang dibeli Pensil[PN] " << "\n"<<"Total Harga = "<<jumlah*pn<<"\n\n";break;
case 3:
cout << "Nama barang yang dibeli Penggaris[PG] " << "\n"<<"Total Harga = "<<jumlah*pg<<"\n\n";break;
}
}
else
{
cout << "Pilih Angka 1 sampai 3 Saja" << "\n\n\n";
}
cout << "Sekian Dan Terimakasih \n\n\n";
}