Ok, lines 26 onward look like you are confused.
Look at your other post, the one with the min, max, and middle. In there you've correctly declared functions and called them.
The real challenge in this program is coming up with an algorithm that correctly determines the season. If you are having trouble doing that, then here's some advice:
Forget programming for the moment. Pretend like you were explaining to a friend how to figure out the season. Explain it using words and phrases like "if", "is less than", and "is between".
Write down your explanation, and then try to re-write the explanation in C++ code.
Example:
Problem: Given three integers (call them A, B, and C), determine which one is the largest.
Explanation:
If A is greater than B and A is greater than C, then the largest is A;
Otherwise, if B is greater than A and B is greater than C, then the largest is B;
Otherwise, C must be the largest.
C++ code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
int max3( int A, int B, int C ) {
// If A is greater than B and A is greater than C, then...
if( A > B && A > C )
// The largest is A
return A;
// Otherwise, if B is greater than A and B is greater than C, then...
else if( B > A && B > C )
// The largest is B
return B;
// Otherwise, ...
else
// C must be the largest
return C;
}
|