I'm not allowed to use an array for this code but I can't figure out how not to.
I need the following code to work unlimited times until 999 is entered then output the information
void process_fees(double cost)
{
int count;
double car[20];
double total=0;
cout << "Please enter the hours" << endl;
for (int i=0; i<20; i++)//I need this to be done unlimited times
{
car[i] = (process_fee() * 3.00);//I need "car" to be saved and output it later
}
}
double process_fee()
{
int hours;
cin >> hours;
if (hours == 999);
elsereturn hours;
}
To do an infinite for loop the code is: for(;;) adn then you can call your function.
Personally though, I would use a do while loop and not use a function call.
Also line 17 doesn't mean anything, there are no statements if the conidiotn is true. I think what you want is if(hours != 999) return hours; #
You don't need to use an array with numbers, using int will be fine.
EDIT*****
Not sure how i missed that before, was doing things at speed! You aren't using any arrays. The statement on line 4 is invalid. I think you need to look over your code again, or maybe restart for ease and really think about how your program is going to run, line by line.
What exactly are you expected to do? If you need the user to input numbers and after inputting 999 return each value * 3 in reverse order, you could use recursion.