Tadi kan berkunjung ke blog temen gue yang namanya Najib terus liat postingannya ada hasil uas dasprog kemaren, hahaha
Intinya gue juga pengen ngepost yang kaya gitu juga, nih hasil uas kemaren.
Tapi ini musti ada banyak perbaikan, karena ini baru tahap beta.
#include<iostream.h>
#include<conio.h>
int many, money, list[4], xoxo[4];
void line();
void menu_ice();
void popup();
void enter();
void delay();
main()
{
cout<<endl;
cout<<" I Scream 4 Ice Cream"<<endl;
cout<<" Electrical Ice Cream Maker"<<endl;
line();
menu_ice();
cout<<" How many will u buy? ";cin>>many;
cout<<" What u want? (choose by the number)"<<endl;
for(int x=0;x<many;x++)
{
cout<<" "<<x+1<<". ";cin>>list[x];
if(list[x]>5)
{
cout<<" Wrong number"<<endl;
cout<<" "<<x+1<<". ";cin>>list[x];
if(list[x]>5)
{
cout<<" Last chois"<<endl;
cout<<" "<<x+1<<". ";cin>>list[x];
}
}
}
popup();
getch();
}
void line()
{
for(int z=0;z<80;z++)
cout<<"_";
cout<<endl;
}
void menu_ice()
{
cout<<" Welcome to Ice Cream World"<<endl;
cout<<endl;
cout<<" Menu : (1) Dead by Chocolate 12.000 IDR"<<endl;
cout<<" (2) Strawbery Anggry Cheese 9.500 IDR"<<endl;
cout<<" (3) Volcano Chery Blossom 10.000 IDR"<<endl;
cout<<" (4) Savana Melon World 8.000 IDR"<<endl;
cout<<" (5) Snow Lake Zoda Acid 11.000 IDR"<<endl;
cout<<endl;
}
void popup()
{
clrscr();
cout<<endl;
cout<<" PLEASE WAIT UR ICE CREAM BEING CREATED"<<endl;;
for(int t=0;t<80;t++)
{
delay();
cout<<".";
}
enter();
}
void delay()
{
for(int f=1;f<100;f++)
for(int h=1;h<100;h++)
for(int p=1;p<150;p++)
cout<<"";
}
void enter()
{
clrscr();
int jumlah, jumlih;
jumlah=0;
cout<<endl;
cout<<" List of ur Ice Cream "<<endl;
for(int o=0;o<many;o++)
{
if(list[o]==1)
cout<<" "<<o+1<<". Dead by Chocolate"<<endl;
else if(list[o]==2)
cout<<" "<<o+1<<". Strawbery Anggry Cheese"<<endl;
else if(list[o]==3)
cout<<" "<<o+1<<". Volcano Chery Blossom"<<endl;
else if(list[o]==4)
cout<<" "<<o+1<<". Savana Melon World"<<endl;
else
cout<<" "<<o+1<<". Snow Lake Zoda Acid"<<endl;
}
cout<<endl;
cout<<" Insert ur money to machine to get the Ice Cream which u want."<<endl;
for(int v=0;v<many;v++)
{
if(list[v]==1)
xoxo[v]=12000;
else if(list[v]==2)
xoxo[v]=9500;
else if(list[v]==3)
xoxo[v]=10000;
else if(list[v]==4)
xoxo[v]=8000;
else
xoxo[v]=11000;
}
cout<<" Total + Tax = ";
for(int y=0;y<5;y++)
{
jumlah=jumlah+xoxo[y];
}
cout<<jumlah<<endl;
cout<<" Type total money --> ";cin>>money;
if(money<jumlah)
{
cout<<" Sory ur money less, input again money"<<endl;
cout<<" Type total money --> ";cin>>money;
if(money<jumlah)
{
cout<<" Sory ur money less, input again money"<<endl;
cout<<" Type total money --> ";cin>>money;
if(money<jumlah)
{
cout<<" Machine ERORR!!!!!"<<endl;
}
}
}
else if(money==jumlah)
cout<<" Enjoy ur Ice Cream :)"<<endl;
else if(money>jumlah)
{
jumlih=money-jumlah;
cout<<" Change due : "<<jumlih<<endl;
cout<<" Enjoy ur Ice Cream :)"<<endl;
}
}
0 komentar:
Pembaca bijak ninggalin jejak, ada komentar? tulis aja...