#include<iostream>
using namespace std;
main()
{
int numGame,numSocks,numShoes;
int countX = 1,countY = 0;
float tempGame = 0,tempSocks = 0,tempShoes = 0,GrandTotal = 0;
float totalP,priceGame,priceSocks,priceShoes;
cout<<"Welcome to Numbani Bowling Arena Transaction System.\n";
cout<<"Please fill in the required sections below.\n";
cout<<"---------------------------------------------------------\n";
while( countX > -1 )
{
countY = countY + 1;
cout<<"Enter the number of game(s) you want to play.\n";
cin>>numGame;
if( numGame > 0 && numGame < 4)
{
priceGame = numGame * 8.00;
tempGame = tempGame + priceGame;
}
else if( numGame > 3 && numGame < 9)
{
priceGame = numGame * 7.50;
tempGame = tempGame + priceGame;
}
else if( numGame > 8)
{
priceGame = numGame * 7.00;
tempGame = tempGame + priceGame;
}
cout<<"\nEnter the number of shoe(s) you that are required.\n";
cin>>numShoes;
priceShoes = numShoes * 3.00;
tempShoes = tempShoes + priceShoes;
cout<<"\nEnter the number of pairing socks you that are required.\n";
cin>>numSocks;
priceSocks = numSocks * 2.50;
tempSocks = tempSocks + priceSocks;
totalP = priceGame + priceSocks + priceShoes;
GrandTotal = tempGame + tempShoes + tempSocks;
cout<<"\nTotal price for game(s) is RM"<<priceGame;
cout<<"\nTotal price for shoes is RM"<<priceShoes;
cout<<"\nTotal price for socks is RM"<<priceSocks;
cout<<"\nGrand total for all is RM"<<totalP<<"\n";
cout<<"\nEnter any positive number to continue executing the program.(Ex. 1,2,3,4,...)";
cout<<"\nEnter any negative number to exit the program.(Ex. -1,-2,-3,-4,...)\n";
cin>>countX;
cout<<"----------------------------------------------------------------------------------------\n\n";
}
cout<<"\nThank you for using the system.\n";
cout<<"\n\nGrand total for all transactions is RM"<<GrandTotal;
cout<<"\nTotal transactions made by users is "<<countY;
cout<<"\n\nHave a nice day!\n\n";
system("PAUSE");
return 0;
}
Faez_1 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.