#include
#include
using namespace std;
int main()
{
int number;
float cost;
char beverage;
bool validBeverage;
cou
Change
while(beverage!='e'||beverage!='E'); // Condition becomes true always
to
while(beverage!='e'&& beverage!='E');
And similarly replace all ||
by &&
in first while loop conditional expression
while(beverage!='A' && beverage!='B' &&beverage!='C'&& beverage!='D' && beverage!='E' && beverage!='a' && beverage!='b' && beverage!='c' &&
beverage!='d' && beverage!='e')
Take this condition as an example, the same problem is in others as well.
while (beverage!='e'||beverage!='E');
A character is either not equal to 'e'
, or it is equal to 'e'
, in which case it's not equal to 'E'
, so the condition is always true.
What you want is logical and.