Scriptnya bisa dicoba, dan apabila berhasil mudah - mudahan bisa diamalkan ke orang lain yang belum tau.
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main()
{
char gol,merk[50];
int jumlah;
long harga,total;
clrscr();
cout<<endl<<" Cat Tembok "<<endl
<<" = = = = = = = = = = = = = = = ="<<endl;
cout<<" Pilih kode cat tembok [A/B/C]: ";cin>>gol;
cout<<" Masukkan Jumlah Beli : ";cin>>jumlah;
if(gol=='A' || gol=='a')
{
strcpy(merk,"Nipon");
harga=50000;
jumlah;
total=jumlah*harga;
}
else if(gol=='B' || gol=='b')
{
strcpy(merk,"Dulux");
harga=55000;
jumlah;
total=jumlah*harga;
}
else if(gol=='C' || gol=='c')
{
strcpy(merk,"Aviant");
harga=60000;
jumlah;
total=jumlah*harga;
}
else
cout<<" Salah Kode"<<endl;
cout<<" Merk Cat = "<<merk<<endl;
cout<<" Harga Cat = "<<harga<<endl;
cout<<" Jumlah Beli = "<<jumlah<<endl;
cout<<" Total Harga = "<<total<<endl;
getch();
}
Share this article with your friends
Posting Komentar
Jangan berkunjung tanpa meninggalkan jejak.
- No Spam - No Phising - No Live Link
Salam Blogger Indonesia, Silakan Tinggalkan Pesan Agan disini... !!!