begin model gradeCountSpec
| begin input variables
| | N_BOUND : int;
| | | gradeCountSpec.c 1.13--2.12: "input {N_BOUND > 0}int N_BOUND;"
| | N : int;
| | | gradeCountSpec.c 3.13--4.6: "input {N > 0 && N < N_BOUND} int N;"
| | scores : real[N];
| | | gradeCountSpec.c 5.13--6.17: "input double scores[N];"
| end input variables;
| begin output variables
| | excessiveFailure : int;
| | | gradeCountSpec.c 7.13--8.21: "output int excessiveFailure;"
| end output variables;
| begin process 0
| | main function : main;
| | begin process variables
| | | failureFlag : int;
| | | | gradeCountSpec.c 9.0--9.20: "int failureFlag = 0;"
| | | numGrade : int[5];
| | | | gradeCountSpec.c 10.0--10.16: "int numGrade[5];"
| | end process variables;
| | begin function main
| | | | gradeCountSpec.c 12.0--12.11: "void main()"
| | | begin proper local variables
| | | | i : int = 0;
| | | | | gradeCountSpec.c 13.1--13.11: "int i = 0;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : CHOICE;
| | | | when i < 5 goto location 1;
| | | | | gradeCountSpec.c 15.1--15.18: "for(; i < 5; i++)"
| | | | when !i < 5 goto location 3;
| | | | | gradeCountSpec.c 15.1--15.18: "for(; i < 5; i++)"
| | | end location 0;
| | | begin location 1
| | | | kind : ASSIGNMENT;
| | | | numGrade[i] = 0; goto location 2;
| | | | | gradeCountSpec.c 16.2--16.18: "numGrade[i] = 0;"
| | | end location 1;
| | | begin location 2
| | | | kind : ASSIGNMENT;
| | | | i = i+1; goto location 0;
| | | | | gradeCountSpec.c 15.14--15.17: "i++"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSIGNMENT;
| | | | i = 0; goto location 4;
| | | | | gradeCountSpec.c 17.1--17.5: "i=0;"
| | | end location 3;
| | | begin location 4
| | | | kind : CHOICE;
| | | | label : l;
| | | | when i < N goto location 5;
| | | | | gradeCountSpec.c 19.1--19.13: "while(i < N)"
| | | | when !i < N goto location 17;
| | | | | gradeCountSpec.c 19.1--19.13: "while(i < N)"
| | | end location 4;
| | | begin location 5
| | | | kind : CHOICE;
| | | | when (90) <= scores[i] goto location 6;
| | | | | gradeCountSpec.c 20.2--20.23: "if(scores[i] >= 90.0)"
| | | | when !(90) <= scores[i] goto location 7;
| | | | | gradeCountSpec.c 20.2--20.23: "if(scores[i] >= 90.0)"
| | | end location 5;
| | | begin location 6
| | | | kind : ASSIGNMENT;
| | | | numGrade[0] = numGrade[0]+1; goto location 14;
| | | | | gradeCountSpec.c 21.3--21.17: "numGrade[0]++;"
| | | end location 6;
| | | begin location 7
| | | | kind : CHOICE;
| | | | when (80) <= scores[i] goto location 8;
| | | | | gradeCountSpec.c 22.7--22.28: "if(scores[i] >= 80.0)"
| | | | when !(80) <= scores[i] goto location 9;
| | | | | gradeCountSpec.c 22.7--22.28: "if(scores[i] >= 80.0)"
| | | end location 7;
| | | begin location 8
| | | | kind : ASSIGNMENT;
| | | | numGrade[1] = numGrade[1]+1; goto location 14;
| | | | | gradeCountSpec.c 23.3--23.17: "numGrade[1]++;"
| | | end location 8;
| | | begin location 9
| | | | kind : CHOICE;
| | | | when (70) <= scores[i] goto location 10;
| | | | | gradeCountSpec.c 24.7--24.28: "if(scores[i] >= 70.0)"
| | | | when !(70) <= scores[i] goto location 11;
| | | | | gradeCountSpec.c 24.7--24.28: "if(scores[i] >= 70.0)"
| | | end location 9;
| | | begin location 10
| | | | kind : ASSIGNMENT;
| | | | numGrade[2] = numGrade[2]+1; goto location 14;
| | | | | gradeCountSpec.c 25.3--25.17: "numGrade[2]++;"
| | | end location 10;
| | | begin location 11
| | | | kind : CHOICE;
| | | | when (60) <= scores[i] goto location 12;
| | | | | gradeCountSpec.c 26.7--26.28: "if(scores[i] >= 60.0)"
| | | | when !(60) <= scores[i] goto location 13;
| | | | | gradeCountSpec.c 26.7--26.28: "if(scores[i] >= 60.0)"
| | | end location 11;
| | | begin location 12
| | | | kind : ASSIGNMENT;
| | | | numGrade[3] = numGrade[3]+1; goto location 14;
| | | | | gradeCountSpec.c 27.3--27.17: "numGrade[3]++;"
| | | end location 12;
| | | begin location 13
| | | | kind : ASSIGNMENT;
| | | | numGrade[4] = numGrade[4]+1; goto location 14;
| | | | | gradeCountSpec.c 29.3--29.17: "numGrade[4]++;"
| | | end location 13;
| | | begin location 14
| | | | kind : CHOICE;
| | | | when 10 < numGrade[4] goto location 15;
| | | | | gradeCountSpec.c 30.2--30.22: "if(numGrade[4] > 10)"
| | | | when !10 < numGrade[4] goto location 16;
| | | | | gradeCountSpec.c 30.2--30.22: "if(numGrade[4] > 10)"
| | | end location 14;
| | | begin location 15
| | | | kind : ASSIGNMENT;
| | | | failureFlag = 1; goto location 16;
| | | | | gradeCountSpec.c 31.3--31.19: "failureFlag = 1;"
| | | end location 15;
| | | begin location 16
| | | | kind : ASSIGNMENT;
| | | | i = i+1; goto location 4;
| | | | | gradeCountSpec.c 32.2--32.6: "i++;"
| | | end location 16;
| | | begin location 17
| | | | kind : ASSIGNMENT;
| | | | excessiveFailure = failureFlag; goto location 18;
| | | | | gradeCountSpec.c 34.1--34.32: "excessiveFailure = failureFlag;"
| | | end location 17;
| | | begin location 18
| | | | kind : RETURN;
| | | | return null; goto location 19;
| | | | | gradeCountSpec.c 35.0--35.0: "}"
| | | end location 18;
| | | begin location 19
| | | | kind : TERMINAL;
| | | end location 19;
| | end function main;
| end process 0;
end model gradeCountSpec.
