help

how to add ceil function to my value added tax need help tnx here is my program.

#include<iostream>
#include<time.h>
#include<cmath>
using namespace std;
int main()
{
char *kinds[5] = {" Bokia 3210"," Bokia C3"," Bokia Ashe"," Bokia Droid"," Bokia Lumia"},pitz;
int order1=0,order2=0,order3=0,order4=0,order5=0,quantity,bokia,;
double b3210=2245.50,bc3=2299.50,bashe=2699.50,bdroid=2999.50,blumia=2199.50;
double tax;

float payable=0,cash,price,change,total1=0,total2=0,total3=0,total4=0,total5=0,sum = 0,n;

cout<<"\a\t\t\t -Welcome to BokiaMobiles-\n"<<endl;
cout<<"\tPlease choose your wanted mobile: "<<endl;
cout<<"\n\t\t 1)Bokia 3210 P2245.50";
cout<<"\n\t\t 2)Bokia C3 P2299.50";
cout<<"\n\t\t 3)Bokia Ashe P2699.50";
cout<<"\n\t\t 4)Bokia Droid P2999.50";
cout<<"\n\t\t 5)Bokia Lumia P2199.50";
cout<<endl;


do {
cout<<"\n\t\t Please choose your mobile from the list: ";
cin>>bokia;
payable=payable+total1;


switch (bokia) {
case 1:
cout<<"\n\tYou ordered for:"<<kinds[0]<<endl;
cout<<"\tPrice: P"<<b3210<<endl;
cout<<"\tHow many: ";
cin>>order1;
total1=b3210*order1;
cout<<"\tTotal: P"<<total1<<endl;
break;
case 2:
cout<<"\n\tYou ordered for:"<<kinds[1]<<endl;
cout<<"\tPrice: P"<<bc3<<endl;
cout<<"\tHow many: ";
cin>>order2;
total2=bc3*order2;
cout<<"\tTotal: P"<<total2<<endl;
break;
case 3:
cout<<"\n\tYou ordered for:"<<kinds[2]<<endl;
cout<<"\tPrice: P"<<bashe<<endl;
cout<<"\tHow many: ";
cin>>order3;
total3=bashe*order3;
cout<<"\tTotal: P"<<total3<<endl;
break;
case 4:
cout<<"\n\tYou ordered for:"<<kinds[3]<<endl;
cout<<"\tPrice: P"<<bdroid<<endl;
cout<<"\tHow many: ";
cin>>order4;
total4=bdroid*order4;
cout<<"\tTotal: P"<<total4<<endl;
break;
case 5:
cout<<"\n\tYou ordered for:"<<kinds[4]<<endl;
cout<<"\tPrice: P"<<blumia<<endl;
cout<<"\tHow many: ";
cin>>order5;
total5=blumia*order5;
cout<<"\tTotal: P"<<total5<<endl;
break;
default:
cout<<"\a\n\n\t\t\tSorry it is not available here."<<endl<<endl;
char f;
cout<<"\tWould you like to reset the program to choose another mobile?(Y or N): ";
cin>>f;
system("cls");
if((f=='Y')||(f=='y')) {


} else {
return(0);
}
break;

}
cout << "\n\t\t\tDo you want to order another mobile? (y/n)? ";
cin >> pitz;
}
while ((pitz == 'y')||(pitz == 'Y'));
payable=payable+total1+total2+total3+total4+total5;
cout<<"\n\tAmount to be paid: P"<<payable;

do {
cout<<"\n\tYour cash is: P";
cin>>cash;
if (cash<payable){
cout<<"\a\n\t\t\t Your money is not enough. "<<endl;
}
}

while (cash<payable);

change=cash-payable;
cout<<"\n\tYour change is: P"<<change<<"\n\n"<<endl<<endl;

cout<<"\t\t For your receipt: ";
system("pause");
system("cls");







cout<<"\t\t\t O F F I C I A L R E C E I P T"<<endl;
cout<<"\n\t\t\t -BokiaMobiles-\n";


cout<<"\n\tYou ordered for numbers: ";
quantity=order1+order2+order3+order4+order5;
tax = payable*.12;
cout<<"\n\tTotal quantity: "<<quantity;
cout<<"\t\t\t\t Cash: P"<<cash;
cout<<"\n\tTotal: P"<<payable;
cout<<"\t\t\t\t\t Change: P"<<change;
cout<<"\t\t\t\t\t Value Added Tax: "<<tax;
cout<<"\a\n\t\t\t Thank you,please come again!"<<endl;
cout<<"\tFor *orders *comments or *suggestions please contact: 09270754494"<<endl;
cout<<"\tEmail @: BokiaMobiles@gmail.com"<<endl;
cout <<"\n\tTime: "<<__TIME__;
cout<<"\t\t\t\tCreated by: ";
cout<<"\n\tDate: "<<__DATE__<<endl;




getchar();
cin.get();
}
Maybe you can jut use ceil() function from <cmath>?
http://cplusplus.com/reference/cmath/ceil/
Topic archived. No new replies allowed.