Im trying to have this program continue to run when you enter y or Y at the end or quit when you enter n or N. Everything I try either has it just end or continue to repeat. Any help would be great, thanks!
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
double caterCalc(int, double);
int main ()
{
int quantity;
double price;
char c;
while (c == 'y' || 'Y') {
cout << "How many people are coming: ";
cin >> quantity;
cout << "What is the price per person: ";
cin >> price;
cout << "The total price is: $"<< caterCalc(quantity, price);
cout << "\n\nDo you want to run this again? (y/n)";
cin >> c;
if (c == 'n' || 'N') {
break;
}
}
cin.get();
return 0;
}
double caterCalc(int quantity, double price)
{
double total = quantity*price;
return total;
}