Feb 14, 2016 at 10:26am UTC
please help me how to convert my programming from c++ to c language :(
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
char choice='Y';
int order = 1;
int num1, num2, num3, num4, num5, num6=0;
int num_customers;
int sentinel=0;
const double UnitPrice1= 7.50, UnitPrice2= 8.00,UnitPrice3= 7.00, UnitPrice4= 7.00, UnitPrice5= 4.00, UnitPrice6= 7.00;
double AmountofSale1=0, AmountofSale2=0, AmountofSale3=0, AmountofSale4=0, AmountofSale5=0, AmountofSale6=0;
int sum1=0, sum2=0, sum3=0, sum4=0, sum5=0, sum6=0;
cout<<"____________________________________________________________________\n\n"
<<" # WELCOME TO # \n"
<<" # JIMI BURN BURGER PANAS SIOT # \n"//title of the product
<<"____________________________________________________________________\n"//menu
<<" ~~~~ MENU ~~~~ \n"
<<"(1) BURGER AYAM KAMPUNG RM 7.50\n"
<<"(2) BURGER DAGING PANGGANG RM 8.00\n"
<<"(3) BURGER SPECIAL RM 7.00\n"//menu user can use
<<"(4) BURGER CRISPY CHEESE RM 7.00\n"
<<"(5) BURGER TELUR CHEESE RM 4.00\n"
<<"(6) BURGER CHEESE LELEH RM 7.00\n\n"
<<" Untuk meredakan kepanasan kami mengediakan AIR MINERAL 'FREE' !!!\n"
<<"___________________________________________________________________\n\n";
while(order!=sentinel)
{
cout<<"SET MANA YANG ANDA MAHUKAN:\n";
cin>>order;
switch(order)
{
case 0:
break;
case 1:
cout<<"Jumlah BURGER AYAM KAMPUNG yang anda mahu:\n";
cin>>num1;
sum1 += num1;
AmountofSale1 = UnitPrice1 * sum1;
break;
case 2:
cout<<"Jumlah BURGER DAGING PANGGANG yang anda mahu:\n";
cin>>num2;
sum2 += num2;
AmountofSale2 = UnitPrice2 * sum2;
break;
case 3:
cout<<"Jumlah BURGER SPECIAL yang anda mahu:\n";
cin>>num3;
sum3 += num3;
AmountofSale3 = UnitPrice3 * sum3;
break;
case 4:
cout<<"Jumlah BURGER CRISPY CHEESE yang anda mahu:\n";
cin>>num4;
sum4 += num4;
AmountofSale4 = UnitPrice4 * sum4;
break;
case 5:
cout<<"Jumlah BURGER TELUR CHEESE yang anda mahu:\n";
cin>>num5;
sum5 += num5;
AmountofSale5 = UnitPrice5 * sum5;
break;
case 6:
cout<<"Jumlah BURGER CHEESE LELEH yang anda mahu:\n";
cin>>num6;
sum6 += num6;
AmountofSale6 = UnitPrice6 * sum6;
break;
default: cout<<"SILA PILIH MENGIKUT MENU DI ATAS!!!!!!\n";
}
double Total = AmountofSale1 + AmountofSale2 + AmountofSale3 + AmountofSale4 + AmountofSale5 + AmountofSale6;
{
printf("___________________________________________________________________\n\n");
cout<<"Yang telah anda order:\n\n";
cout<<left<<setw(15)<<"ITEM"<<right<<setw(15)<<"QUANTITY"<<right<<setw(18)<<"UNIT PRICE(RM)"<<right<<setw(25)<<"AMOUNT OF SALE(RM)\n";
cout<<"(1) BURGER AYAM :"<<setw(10)<<left<< sum1 <<setw(8)<<right<< UnitPrice1 <<setw(16) <<right<< AmountofSale1<<endl;
cout<<"(2) BURGER DAGING :"<<setw(10)<<left<< sum2 <<setw(8)<<right<< UnitPrice2 <<setw(16) <<right<< AmountofSale2<<endl;
cout<<"(3) BURGER SPECIAL :"<<setw(10)<<left<< sum3 <<setw(8)<<right<< UnitPrice3 <<setw(16) <<right<< AmountofSale3<<endl;
cout<<"(4) BURGER DOUBLE :"<<setw(10)<<left<< sum4 <<setw(8)<<right<< UnitPrice4 <<setw(16) <<right<< AmountofSale4<<endl;
cout<<"(5) BURGER TELUR :"<<setw(10)<<left<< sum5 <<setw(8)<<right<< UnitPrice5 <<setw(16) <<right<< AmountofSale5<<endl;
cout<<"(6) BURGER CHEESE LELEH :"<<setw(10)<<left<< sum6 <<setw(8)<<right<< UnitPrice6 <<setw(16) <<right<< AmountofSale6<<endl;
printf("-------------------------------------------------------------------\n");
cout<<"TOTAL (RM):"<<setw(0) <<right<< Total<<endl;
printf("-------------------------------------------------------------------\n");
printf("___________________________________________________________________\n");
}
}
system("PAUSE");
return 0;
}//main
Feb 14, 2016 at 10:29am UTC
Post in the job section and dont forget to mention how much you're willing to pay