Okay, first, it looks like you are trying to use "hours" and "charges" as types.
Code:
double hours __gc[] = new double __gc[10];
double charges __gc[] = new double __gc[10];
So, it looks like you are defining "__gc" twice, once as the (as far as I know) nonexistant type "array of double hours", and another time as "array of double charges". Later, you refer to these as "hours[]" and "charges[]". Therefore, change your bad declarations to these:
Code:
double hours[] = new double [10];
double charges[] = new double [10];
Next, if statements require () around their condition.
should be
Code:
do
Console::WriteLine( L"Enter the number of hours parked:" );
hours[i] = Double::Parse( Console::ReadLine() );
if hours[i] > 24
Console::WriteLine( L"Maximum number of hours has been exceeded");
while hours[i] > 24
Here, you tried to make a do/if statement which don't exist (at least in C).
Another error is here:
Code:
charges[i] = ((hours - 2) * .5) + 5;
You refer to "hours" which is the address of the first element of the array hours. This should be changed to "hours[0]", "hours[i]", or whatever element of the array hours[] you mean.
All in all, it looks like you're using Perl syntax in C++, so... learn C++!
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum