Feb 25, 2012 at 7:07am UTC
#include<iostream>
#include<cmath>
using namespace std;
void main()
{
int code, qty, cash;
double tDue, change;
cout<<"\t\t\tWelcome to DuaNetopia!"<<endl<<endl;
cout<<"Hour Codes and Price"<<endl<<endl;
cout<<"1 1 Hour Php25"<<endl;
cout<<"2 2 Hours Php50"<<endl;
cout<<"3 3 Hours Php75"<<endl;
cout<<"4 4 Hours Php100"<<endl;
cout<<"5 5 Hours Php120 Promo!"<<endl;
cout<<"6 Play All You Can Php1000"<<endl<<endl;
cout<<"Enter Code: ";
cin>>code;
switch (code)
{
case 1: cout<<"1 Hour Php25";
cout<<"How Many?: ";
cin>>qty;
{
if (qty<0)
cout<<"Invalid Quantity Number"<<endl;
else
tDue=25*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
case 2: cout<<" 2 Hours Php50"<<endl;
cout<<"How Many?: ";
cin>>qty;
{
if (qty<0)
cout<<"Invalid Quantity Number"<<endl;
else
tDue=50*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
case 3: cout<<"3 Hours Php75";
cout<<" How Many?: ";
cin>>qty;
{
if (qty<0)
cout<<"Invalid Quantity Number"<<endl;
else
tDue=75*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
case 4: cout<<"4 Hours Php100";
cout<<" How Many?: ";
cin>>qty;
{
if (qty<0)
cout<<"Invalid Quantity Number"<<endl;
else
tDue=100*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
case 5: cout<<"5 Hours Php120 Promo!";
cout<<" How Many?: ";
cin>>qty;
{
if (qty<0)
cout<<"Invalid Quantity Number"<<endl;
else
tDue=120*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
case 6: cout<<"Play All You Can Php1000";
tDue=1000*qty;
cout<<"Total Due: "<<tDue<<endl;
}
cout<<"Cash: ";
cin>>cash;
change=cash-tDue;
{
if (cash<0 || cash<tDue)
cout<<"Invalid Cash"<<endl;
else
cout<<"Change: "<<change<<endl<<endl;
}
break;
default: cout<<"Invalid Hour Code"<<endl<<endl;
}
cout<<"=============== CHANGE BREAKDOWN ==============="<<endl;