Hey guys I'm new to c++. Would love some help with this program :)
I'm having trouble with the switch statements as my compiler gives me the following errors: case '2' not within a switch statement, case '3' not within a switch statement, case '4' not within a switch statement, case '5' not within a switch statement.
I'm wanting to know why my compiler gives me these errors and where I went wrong.
Here's the full program:
#include <iostream>
using namespace std;
const float maxPerUnit = 20000.00;
//minPerChild includes a standard gift consisting of a bath towel and a facecloth
const float minPerChild = 100.00;
const float maxPerChild = 180.00;
//depending on the amount, the child may also get one or more of the following;
const float TOOTHBRUSH = 29.95;
const float HIGHLIGHTERS = 25.95;
const float CRAYONS = 17.95;
const float NOTEBOOK = 12.95;
const float PEN = 9.99;
int main()
{
float amtGift; // Allowed amount per child
float amtSpentPerChild = 0.00; // actual amount spent per child
float totalSpent = 0.00; // total spent for 1 orphanage
float totalAll = 0.00; // total spent for all 4 orphanages
int nrChildren;