Question 1175279: The “int()” operator in your calculator is the “greatest integer function.” It returns the
greatest integer less than or equal to the operand and is written using square brackets: [x]
or [[x]]. For example, it would give back 82 for [[82.976]].
In Smalltown, AZ the students receive grade points as follows:
4.0 for any grade 90% or higher. [90,100)
3.0 for any grade 80% or higher. [80,90)
2.0 for any grade 70% or higher. [70,80)
1.0 for any grade 60% or higher. [60,70)
(Notice: students NEVER fail! And students never get 100%!)
A. Write a function that correctly returns grade points for gradesfrom 60% to 100%. (78.45
should give a 2.0). Is your function even, odd, or neither?
Answer by Theo(13342) (Show Source):
You can put this solution on YOUR website! you would use a piecewise function to solve this.
if you let x equal the grade received, then your piecewise function would be:
f(x) = 4 if x = int(90)
f(x) = 3 if x = int(80)
f(x) = 2 if x = int(70)
f(x) = 1 if x = int(60)
as stated in the problem, x could never be 100 and x could never be less than 60 because a grade less than 60 would mean failing.
some examples:
if you got a 97.5, int(x) would be 90 and your grade would be 4.
if you got an 89.999999999, int(x) would be 80 and your grade would be 3.
if you got a 70, int(x) would be 70 and your grade would be 2.
if you got 60.000000000001, int(x) would be 60 and your grade would be 1.
if you want to use the square brackets to indicate the int function, then it would look like this.
f(x) = 4 if [x] = 90
f(x) = 3 if [x] = 80
f(x) = 2 if [x] = 70
f(x) = 1 if [x] = 60
|
|
|