def computeGrade(percentage):
'''
- Return the corresponding letter grade string
based on the value of
percentage using the following scale:
[100 - 90]: 'A'
(90 - 80] : 'B'
(80 - 70] : 'C'
(70 - 60] : 'D'
(60 - 0] : 'F'
- If percentage is not a number type (int or
float) OR if percentage is
outside the range of [100 - 0], return an empty
string ("").
'''
return "stub"
def computeGrade(percentage):
"""
- Return the corresponding letter grade string based on the value of
percentage using the following scale:
[100 - 90]: 'A'
(90 - 80] : 'B'
(80 - 70] : 'C'
(70 - 60] : 'D'
(60 - 0] : 'F'
- If percentage is not a number type (int or float) OR if percentage is
outside the range of [100 - 0], return an empty string ("").
"""
if type(percentage) not in [int, float] or (percentage < 0 or percentage > 100):
return ""
if 90 <= percentage <= 100:
return "A"
elif percentage >= 80:
return "B"
elif percentage >= 70:
return "C"
elif percentage >= 60:
return "D"
else:
return "F"
def computeGrade(percentage): ''' - Return the corresponding letter grade string based on the value...
#write a function with int parameter to return letter grade for integer score # complete the code below: def grader(int1): grade = '' if int1 >=90: grade = 'A' elif int1 >=80: grade = 'B' elif int1 >=70:
p1
p2
in p2 there is a typo, if grade <0 or grade >100: should
be if percent <0 or percent > 100:
Write a program to compute a person's height & print out a message. The user will input feet and inches. The program will convert that to inches, and then print a message, based on the total inches. If the total inches is greater than 72, the message should be something like, "You're tall." If the total inches...
Below is a java program that inputs an integer grade and turns it into a letter grade. Update the below java code as follows and comment each line to explain what is happening: 1. Convert the if-else-if code block to a switch statement to solve the problem. 2. Use modulus to convert the grade input so that the range of grades are converted to one value. (comment the line) import java.util.Scanner; public class GradeLetterTest { public static void main(String[] args)...
Complete the program, Grade.java, below. The program takes in a student's score and prints the corresponding letter grade assuming a standard 60-70-80-90 scale for cutoff of each grade. For example, if a student's score is 52.6 they would be assigned an "F" grade. If a student's score is 87.8 they would be assigned a "B grade. The program should take in the score as a double value and print the letter grade (capitalized letter of A, B, C, D, or...
This C# program prints out a corresponding letter grade for a given mark. It uses a method (called MarktoGrade) to determine the letter grade. MarktoGrade takes one integer call by value formal parameter (called mark) and returns a char value that is the letter grade. All of the input and output (except an error message) is done in Main. There is one syntax error in this program that you will need to fix before it will compile (the error is...
Write a c++ program to compute and print the grade for one student. The grade is based on three mid-term exams (worth a possible 25 points each) of which the best two are only considered in the computation, two quizzes (5 points each), and a 40 points final exam. Your output should include all scores (2 best midterms, 2 quizzes and the final exam), the percentage grade, and the letter grade. Solve it using nested if. The grading scale is:...
Code goes like: #include <stdio.h> /* * askGrade(): * Asks the student for a letter grade * (A = 90-100, B = 80-89, etc.) * then gives the appropriate letter grade in upper case. */ void askGrade() { int grade; printf("Enter your grade:"); scanf("%d", &grade); printf("Your grade is: "); // BEGIN YOUR CODE // TODO: Use if-else statements to print the right letter grade. // END YOUR CODE printf("\n"); } /* * dayOfTheWeek(): *...
Write a C++ program that will provide a user with a grade range if they enter a letter grade. Your program should contain one function. Your function will accept one argument of type char and will not return anything (the return type will be void), but rather print statements to the console. Your main function will contain code to prompt the user to enter a letter grade. It will pass the letter grade entered by the user to your function....
Write a program that will calculate your letter grade at the end of the semester for CSIS130. Your program will read an input file that shall contain all the tests scores and lab scores for the semester, and the input file data should be in the following format: full name of student Test1 Score (0…100), Test2 Score (0..100) , Final Exam Score (0..100), Total Number of Labs: N NLab Scores (0=Fail, 1=Pass) [You will have N lab scores each separated...
1. Create a program that takes a numerical score and outputs a letter grade. 2. In this program, create two void functions titled makeScore and theGrade with an int argument. 3. The function makeScore should have a Reference parameter and theGrade should have a Value parameter. Note: Specific numerical scores and letter grades are listed below: 90-100 = Grade A 80-89 = Grade B 70-79 = Grade C 60-69 = Grade D 0-59 = Grade F 4. The function makeScore...