I’m solving a task in a software testing exam. The compiler is not accepting my answer. I don’t know where the error is.
The company is implementing a new air route display mode for pilots, where routes of different categories change color and display style depending on the flight altitude (altitude is passed as the parameter h, measured in kilometers),(Flight altitude can be fractional.).
Category 1 routes:
- start displaying on instruments at h = 2;
- turn purple at h = 5;
- change color to yellow at h = 8;
- turn green at h = 9;
- remain green, but with a bold outline at h = 12;
- remain green with a bold outline and become semi-transparent at h = 15.
Category 2 routes:
- start displaying at h = 2;
- disappear at h = 15.
Category 3 routes:
- start displaying at h = 12 and are drawn on top of other routes.
Specify all altitude ranges h that can be considered equivalent classes for testing the new air route display mode.
Input format: Write the answer according to mathematical syntax rules: if the inequality is one-sided, the unknown comes first; if it’s a double inequality, the unknown is in the middle. Write the answer in a column. The answer should not contain spaces.
Example answer:
0<=h<3
h>1
I broke down the altitude ranges for each category of routes and then combined the ranges.
Category 1 routes:
- For h<2 – Category 1 routes are not displayed.
- For 2<=h<5 – Category 1 routes are displayed and their color/style changes are not yet in effect.
- For 5<=h<8 – Category 1 routes turn purple.
- For 8<=h<9 – Category 1 routes change color to yellow.
- For 9<=h<12 – Category 1 routes turn green.
- For 12<=h<15 – Category 1 routes remain green with a bold outline.
- For h>=15 – Category 1 routes remain green with a bold outline and become semi-transparent.
Category 2 Routes:
- For h<2 – Category 2 routes are not displayed.
- For 2<=h<15 – Category 2 routes are displayed.
- For h>=15 – Category 2 routes disappear.
Category 3 Routes:
- For h<12 – Category 3 routes are not displayed.
- For h≥12 – Category 3 routes are displayed on top of other routes.
As a result, I got the following equivalent classes.
z<2
2<=z<5
5<=z<8
8<=z<9
9<=z<12
12<=z<15
z>=15
However, the answer is not accepted by the context and is giving an incorrect solution.
The answer:
0<=z<2
2<=z<5
5<=z<8
8<=z<9
9<=z<12
12<=z<15
z>=15
is also not accepted
What am I doing wrong? Or did I do everything correctly and need to inform the instructor about an error?