G
gaga
hi all,
i need to write a program - cash register for dummies, so to speak.
here's the gist - enter the amount of pies that a person wants to get.
A person can get either, 1, 2, 3, or 4 pizza pies. At the end of the
day, the worker enters in -1 (negative 1), as the number of pies, to
indicate to the program that the program is done taking orders for the
day. When the program is done taking orders, display the total number
of pies orders, and the amount of money the pies were in total.
what i have so far is:
#include <iostream>
using namespace std;
const int LOWER_LIMIT = 1;
const int UPPER_LIMIT = 4;
int main()
{
int pieAMOUNT;
cout<<"\t\t Greetings, fellow human!"<<endl<<endl;
while ((pieAMOUNT >= 0) & (pieAMOUNT != -1 )){
cout<< "Please enter amount between one and four that you wish
to purchase: ";
cin>>pieAMOUNT;
if ((pieAMOUNT >= LOWER_LIMIT) & (pieAMOUNT <= UPPER_LIMIT)) {
cout<<"Total price for "<<pieAMOUNT<<" pizza pies is
$"<<pieAMOUNT*5<<endl;
} else {
cout<<"You have entered a wrong amount!"<<endl;
}
}
if (pieAMOUNT = -1) {
cout<<"We are done taking orders for the day"<<endl;
}
return 0;
}
----------------------
i dont understand what features to use in order to save and store and
later find out the total of the pies/prices entered.
if you could give me some hints, i would be more than greatful!!
ps. yes it is a hw, but i dont need the code, i just need to know
which things to read more about and do it myself.
thanks
i need to write a program - cash register for dummies, so to speak.
here's the gist - enter the amount of pies that a person wants to get.
A person can get either, 1, 2, 3, or 4 pizza pies. At the end of the
day, the worker enters in -1 (negative 1), as the number of pies, to
indicate to the program that the program is done taking orders for the
day. When the program is done taking orders, display the total number
of pies orders, and the amount of money the pies were in total.
what i have so far is:
#include <iostream>
using namespace std;
const int LOWER_LIMIT = 1;
const int UPPER_LIMIT = 4;
int main()
{
int pieAMOUNT;
cout<<"\t\t Greetings, fellow human!"<<endl<<endl;
while ((pieAMOUNT >= 0) & (pieAMOUNT != -1 )){
cout<< "Please enter amount between one and four that you wish
to purchase: ";
cin>>pieAMOUNT;
if ((pieAMOUNT >= LOWER_LIMIT) & (pieAMOUNT <= UPPER_LIMIT)) {
cout<<"Total price for "<<pieAMOUNT<<" pizza pies is
$"<<pieAMOUNT*5<<endl;
} else {
cout<<"You have entered a wrong amount!"<<endl;
}
}
if (pieAMOUNT = -1) {
cout<<"We are done taking orders for the day"<<endl;
}
return 0;
}
----------------------
i dont understand what features to use in order to save and store and
later find out the total of the pies/prices entered.
if you could give me some hints, i would be more than greatful!!
ps. yes it is a hw, but i dont need the code, i just need to know
which things to read more about and do it myself.
thanks