Question

First, create two inputs that can be stored in variables consisting of a student's name. When...

First, create two inputs that can be stored in variables consisting of a student's name. When the program begins ask "Who is the first student?" followed by "Who is the second student?" You only have to have two students for this program.

Ask the user for the scores for the last three test grades for each of the students .  

After the user has entered both names, and three scores for each, the program should display the following as output:

The student's name

Display all three test grades

Display an average of the three test grades PER STUDENT

Assign a letter grade to the average score using the following grading scale

100 - 90 : A

89 - 80: B

79 - 70: C

69 - 60 : D

<= 59: F

Finally display the students name along with their letter grade created from Step 4.

The output should look something like this (the format is up to you... it does not have to be perfect... just giving you an example):

Zachary Hamby 100 90 95 Average is 95

Joe Smith 80 80 80 Average is a 80

Zachary Hamby has a(n) A in the class!

Joe Smith has a(n) B in the class!


I need this to be in python language.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
name1 = input("Who is the first student? ")
name2 = input("Who is the second student? ")

scores1 = input('Enter last three test grades for 1st student(separated by space): ')
scores2 = input('Enter last three test grades for 2nd student(separated by space): ')

score1 = [float(x) for x in scores1.split()]
score2 = [float(x) for x in scores2.split()]

avg1 = sum(score1) / 3
avg2 = sum(score2) / 3

if avg1 >= 90:
    grade1 = 'A'
elif avg1 >= 80:
    grade1 = 'B'
elif avg1 >= 70:
    grade1 = 'C'
elif avg1 >= 60:
    grade1 = 'D'
else:
    grade1 = 'E'

if avg2 >= 90:
    grade2 = 'A'
elif avg2 >= 80:
    grade2 = 'B'
elif avg2 >= 70:
    grade2 = 'C'
elif avg2 >= 60:
    grade2 = 'D'
else:
    grade2 = 'E'

print(name1, scores1, 'Average is', avg1)
print(name2, scores2, 'Average is', avg2)
print(name1, 'has a(n)', grade1, 'in the class!')
print(name2, 'has a(n)', grade2, 'in the class!')

Enter last three test grades for 1st student (separated by space): Enter last three test grades for 2nd student (separated by space): Zachary Hamby 100 90 95 Average is 95.0 Joe Smith 80 80 80 Average is 80.0 Zachary Hamby has a (n) A in the class! Joe Smith has a (n) B in the class! Process finished with exit code

Add a comment
Know the answer?
Add Answer to:
First, create two inputs that can be stored in variables consisting of a student's name. When...
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
  • in c++ A: Write a program which ask user to enter 10 student's name and their...

    in c++ A: Write a program which ask user to enter 10 student's name and their grades. Then find the average of all the grades. Output all the grades with student name of whom got the grade over the average.

  • A continuation of your grading software will be made (you do not need your other code...

    A continuation of your grading software will be made (you do not need your other code for this assignment). In this one you will intake a students first name and last name from a file called "students.txt". Next, there is a file called grades.txt that contains the grades in a course. There will be three grades for each student in "grades.txt" (see example file bellow). In "student.txt" there are two students first and last names. In "grades.txt" the grades for...

  • C++ Language A continuation of your grading software will be made you do not need your...

    C++ Language A continuation of your grading software will be made you do not need your other code for this assignment). In this one you will intake a students first name and last name from a file called "students.txt". Next, there is a file called grades.txt that contains the grades in a course. There will be three grades for each student in "grades.txt" (see example file bellow). In "student.txt" there are two students first and last names. In "grades.txt" the...

  • in java plz amaining Time: 1 hour, 49 minutes, 15 seconds. Jestion Completion Status: Write a...

    in java plz amaining Time: 1 hour, 49 minutes, 15 seconds. Jestion Completion Status: Write a program that asks the user for an input file name, open, read ar number of students is not known. For each student there is a name and and display a letter grade for each student and the average test score fc • openFile: This method open and test the file, if file is not found and exit. Otherwise, return the opened file to the...

  • Write the definition of the class Tests such that an object of this class can store...

    Write the definition of the class Tests such that an object of this class can store a student's first name, last name, five test scores, average test score, and grade. (Use an array to store the test scores.) Add constructors and methods to manipulate data stored in an object. Among other things, your class must contain methods to calculate test averages, return test averages, calculate grades, return grades, and modify individual test scores. The method toString must return test data...

  • Create a C++ program to calculate grades as well as descriptive statistics for a set of...

    Create a C++ program to calculate grades as well as descriptive statistics for a set of test scores. The test scores can be entered via a user prompt or through an external file. For each student, you need to provide a student name (string) and a test score (float). The program will do the followings: Assign a grade (A, B, C, D, or F) based on a student’s test score. Display the grade roster as shown below: Name      Test Score    ...

  • Write a Java program that reads a file until the end of the file is encountered....

    Write a Java program that reads a file until the end of the file is encountered. The file consists of an unknown number of students' last names and their corresponding test scores. The scores should be integer values and be within the range of 0 to 100. The first line of the file is the number of tests taken by each student. You may assume the data on the file is valid. The program should display the student's name, average...

  • 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:-...

  • Create a class called Student. This class will hold the first name, last name, and test...

    Create a class called Student. This class will hold the first name, last name, and test grades for a student. Use separate files to create the class (.h and .cpp) Private Variables Two strings for the first and last name A float pointer to hold the starting address for an array of grades An integer for the number of grades Constructor This is to be a default constructor It takes as input the first and last name, and the number...

  • using C# Write a program which calculates student grades for multiple assignments as well as the...

    using C# Write a program which calculates student grades for multiple assignments as well as the per-assignment average. The user should first input the total number of assignments. Then, the user should enter the name of a student as well as a grade for each assignment. After entering the student the user should be asked to enter "Y" if there are more students to enter or "N" if there is not ("N" by default). The user should be able to...

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
ADVERTISEMENT