FUNGSI STRING UPPER

ALGORITMA PEMOGRAMAN - FORMATIF - SEMESTER GANJIL
 avatar
user_9943232100
c_cpp
2 years ago
2.6 kB
3
Indexable
Never
#include <cctype>
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main()
{
    system("color 6");
 int x, hargasatu, level, hargalevel, jumbel, subtotal, diskon, totbay, uabay, ukem;
 char menu[100], kodepaket, atas, bawah, balik,string2[]="CHOOSE PAKET [a/b/c] : ",
  namapembeli[30], meja, alamat[70], member[20];

 atas://label
 system("cls");

 cout<<"\t\t\t AYAM GEPREK MQBL\n";
 cout<<"\t\t BRANCH PONDOK KELAPA JKT\n";
 cout<<"\t\t Jl. Raya Kaliamang No. 12F \n";
 cout<<"\t\t============================="<<endl;
 strupr(string2);
 cout<<string2;cin>>kodepaket;
 if(kodepaket=='A'||kodepaket=='a')
 {
 strcpy(menu, "Ayam Geprek + Keju Mozarella");
 hargasatu=28000;
 }
 else if(kodepaket=='B'||kodepaket=='b')
 {
 strcpy(menu, "Ayam Geprek + Sambal Matah");
 hargasatu=25000;
 }
 else if(kodepaket=='C'||kodepaket=='c')
 {
 strcpy(menu, "Ayam Geprek + Sambal Terasi");
 hargasatu=22000;
 }
 cout<<"CHOOSE LEVEL : "<<endl;
 cout<<"1. Level 1"<<endl;
 cout<<"2. Level 2"<<endl;
 cout<<"3. Level 3"<<endl;
 cout<<"4. Level 4"<<endl;
 cout<<"5. Level 5"<<endl;
 cout<<"Pilih Level [1/2/3/4/5] : ";cin>>level;
 switch(level)
 {
 case 1:
 hargalevel=1000;
 break;
 case 2:
 hargalevel=2000;
 break;
 case 3:
 hargalevel=3000;
 break;
 case 4:
 hargalevel=4000;
 break;
 case 5:
 hargalevel=5000;
 }
 cout<<"==========================="<<endl;
 cout<<"Nama Pembeli : ";cin>>namapembeli;
 cout<<"Meja Makan : ";cin>>meja;

 cout<<"============================"<<endl;
 cout<<"Nama Pembeli : "<<namapembeli<<endl;
 cout<<"Meja Makan : "<<meja<<endl;

 cout<<"Menu : "<<menu<<endl;
 cout<<"Harga : "<<hargasatu<<endl;
 cout<<"Tambah Level : "<<hargalevel<<endl;
 cout<<"Jumlah Beli : ";cin>>jumbel;
 subtotal=hargasatu*jumbel+hargalevel*jumbel;
 cout<<"Sub Total : "<<subtotal<<endl;
 if(jumbel>=6)
 {
 diskon=0.1*hargasatu;
 }
 else if(jumbel>=3)
 {
 diskon=0.02*hargasatu;
 }
 else if(jumbel>=2)
 {
 diskon=0;
 }
 cout<<"Diskon : " <<diskon<<endl;
 totbay=subtotal-diskon;
 cout<<"Total Bayar : " <<totbay<<endl;
 cout<<"=============================\n";
 cout<<"Uang Bayar : " ;cin>>uabay;
 ukem=uabay-totbay;
 cout<<"Uang Kembali : "<<ukem<<endl;
 cout<<"==========TERIMA KASIH=======";
 bawah://label
 cout<<"Input Data Lagi Nggak?[Y/T] : ";balik=getche();
 if(balik=='Y'||balik=='y')

 {
 goto atas;
 }
 else if(balik=='T'||balik=='t')
 {
 system("cls");
 }
 cout<<"Tekan Enter 2x Untuk Keluar";getch();
}