boolean function

have 3 threshold values 90,80,70; four possible grades A,B,C,F; need 3 integers to specify threshold; need a Boolean function with int a, int b, int c as inputs to test input thresholds are valid; first the function should test 100>a>b>c>0 is true or false. is my code too long; does it make sense

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//Function definitions
int A = 4, B = 3, C = 2, F = 1;

bool
testScore(int a, int b, int c){

     float Grade;

	 if (a >= 90) {

		 return 1;
		 //Grade = A;
	 }
	
	 else if (a >= 80 && a <= 89) {

		 return 1;
		 //Grade = B;
	 }

	 else if (a >= 70 && a <= 79) {

		 return 1;
		 //Grade = C;
	 }

	 else if (a <= 69) {

		 return 1;
		 //Grade = F;
	 }

	 else {

		Grade = 0.0;
	 }
		
		return 0;
Makes no sense.

first the function should test 100>a>b>c>0 is true or false.

... and then what?
If the condition is true, then what?
If the condition is not true, then what?

A boolean function returns true or false. A boolean function could take three values and return whether they are ordered descendingly and in range ]0..100[. That would be all it does.

That in itself has nothing to do with grades.
Topic archived. No new replies allowed.