Write a code that asks the user her test score (with an inputbox). Then report the user her letter grade with a message box.
Test score > 90 a Grade is A
90>=Test score>80 a Grade is B
80>= Test score >70 a Grade is C
70>= Test score >60 a Grade is D
60> Test score a The student failed the test.
Here' the answer to the question. please write back in case you've doubts.
Here below, we code the statement logic in R programming software:
The following R scripts asks her Score ( here declared 100) and then assigns a letter code grade in the variable "Grade".
# declare your score here.
Score <- 100
if ( Score > 90) {
Grade <- 'A'
} else if ( Score > 80 & Score <= 90) {
Grade <- 'B'
} else if ( Score > 70 & Score <= 80) {
Grade <- 'C'
} else if ( Score > 60 & Score <= 70) {
Grade <- 'D'
} else if ( Score < 60 ) {
Grade <- 'Failed the Test'
}
Get Answers For Free
Most questions answered within 1 hours.