Question

Check our syllabus for the grading policy: A+: [97,infinity) A: [93,97) A-: [90,93) B+: [87,90) B:...

Check our syllabus for the grading policy: A+: [97,infinity) A: [93,97) A-: [90,93) B+: [87,90) B: [83,87) B-: [80,83) C+: [77,80) C: [73,77) C-: [70,73) D+: [67,70) D: [63,67) D-: [60,63) F: [0,60) Write a function letterGrade(points) where the input points is a non-negative number. Use the python language to solve the problem. The function should return the letter grade.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def letterGrade(points):
    if(points>=97):
        return "A+"
    elif(points>=93):
        return "A"
    elif (points >= 90):
        return "A-"
    elif (points >= 87):
        return "B+"
    elif (points >= 83):
        return "B"
    elif (points >= 80):
        return "B-"
    elif (points >= 77):
        return "C+"
    elif (points >= 73):
        return "C"
    elif (points >= 70):
        return "C-"
    elif (points >= 67):
        return "D+"
    elif (points >= 63):
        return "D"
    elif (points >= 60):
        return "D-"
    else:
        return 'F'

# Testing
print(letterGrade(78))

Output:

C+

Note: Please comment below if you have any doubtsPlease up vote the solution if it helped. Thanks!

Add a comment
Know the answer?
Add Answer to:
Check our syllabus for the grading policy: A+: [97,infinity) A: [93,97) A-: [90,93) B+: [87,90) B:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • [Using Python] Use the grade scale in the syllabus for this class, write a program that...

    [Using Python] Use the grade scale in the syllabus for this class, write a program that inputs a score, and prints the grade for that score. For example, if I input 90.0, your program should print A. Grading Scale is: 100% - 90% A 89% - 80% B 79% - 70% C 69% - 60% D 59% - 0% E

  • Write a grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • //What's wrong with my code? int run() {    // Don't change anything inside this function...

    //What's wrong with my code? int run() {    // Don't change anything inside this function    printTitle();    string letterGrade = getInput();    double points = letterToPoints(letterGrade);    printReport(points); return 0; } // Implement your functions here void printTitle() {     cout << STUDENT << "-H02-Grade Calculator" << endl;    cout << "-----------------------------------------" << endl; } string getInput() {    cout << "Enter your letter grade: ";    string gradeIn;    getline(cin, gradeIn);    cin >> gradeIn;    return...

  • Solve This Problem using python and please comment on every line. also, use function to solve...

    Solve This Problem using python and please comment on every line. also, use function to solve this. thanks The result will be like as below: Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program: This function should accept five test scores as arguments and return the average of the scores. This function should accept a...

  • 1.1. Write a function named "areFirstTwoTheSame AsLast TwoChars" that accepts a string. It returns true if...

    1.1. Write a function named "areFirstTwoTheSame AsLast TwoChars" that accepts a string. It returns true if the first two characters and the last two characters of the string are the same. It returns false otherwise. In addition, if the string is empty or has only one character, it also returns false. For example, these are the strings with their expected return values false falsc "AB" true "ABA" false "ABAB" trus "ABBA" false "ABCABC false "ABCCAB" true 1.2 Write a function...

  • Grading Policy In addition to three in-class tests and a final exam, the final grade will...

    Grading Policy In addition to three in-class tests and a final exam, the final grade will include assessment of homework, quiz projects/classroom activities, and classroom participation, according to the following weights 1. Homework and Worksheets 2. Three Tests 3. Final Exam 4. Quizzes and Class Participation/Classroom Citizenshi 1 5% 40% 25% 20% Total 100% Grad Ran 92 100 90-91 88-89 82-87 80-81 an 78 -79 70-77 68 -69 66 67 60- 65 Assignment Grading: Each written assignment, except the Final...

  • using if/switch statements (C++) Write a grading program for a class with the following grading policies:...

    using if/switch statements (C++) Write a grading program for a class with the following grading policies: There are two quizzes, each graded on the basis of 10 points There is one midterm exam and one final exam, each graded on the basis of 100 points The final exam counts for 50% of the grade, the midterm counts for 25% and the two quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They should...

  • use python Write function letter2number() that takes as input a letter grade (A, B, C, D,...

    use python Write function letter2number() that takes as input a letter grade (A, B, C, D, F, possibly with a - or +) and returns the corresponding number grade. The numeric values for A, B, C, D, and F are 4, 3, 2, 1, 0. A + increases the number grade value by 0.3 and a - decreases it by 0.3. >>> letter2number('A-') 3.7 >>> letter2number('B+') 3.3 >>> letter2number('D') 1.0

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • Write a grading program in Java for a class with the following grading policies: There are...

    Write a grading program in Java for a class with the following grading policies: There are three quizzes, each graded on the basis of 10 points. There is one midterm exam, graded on the basis of 100 points. There is one final exam, graded on the basis of 100 points. The final exam counts for 40% of the grade. The midterm counts for 35% of the grade. The three quizzes together count for a total of 25% of the grade....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT