Help with Python Program: Calculate Student Grades & Averages

In summary, the program asks the person to enter a student's name, then a grade (there has to be a few grades because you will need to count the average of every student). The program asks the person to keep on entering the grade until the grade is entered correctly (that means the grade cannot go higher than 10). When the name and number is entered correctly, the program asks to enter a new name and grade. The cycle is broken off when a 0 is entered.
  • #1
acurate
17
1
I really need help with a big Python program. Our professor has been MIA for the whole term and now we need to submit a program. I thought I was doing and learning fine on my own, but the program simply does not work for me.

I need it till Thursday and I am ripping my hair out because I cannot afford getting a bad grade on this work.

The program is

Using the input function, the program asks to enter a student's name, then a grade (there has to be a few grades because you will need to count the average of every student). The program asks the person to keep on entering the grade until the grade is entered correctly (that means the grade cannot go higher than 10). When the name and number is entered correctly, the program asks to enter a new name and grade. The cycle is broken off when a 0 is entered.

The grades are listed by the name (from A - Z).

At the end of the program there has to be this information written about every student (name):

Name, his grades and the average of his given grades.

There has to be #comments made in the program to explain what you did.


Thank you for anyone that can help! I'm in a crisis.

Here's how I think it should start but I am not sure, even hints or SUGGESTIONS will be fine.

Code:
class Student(object):
    def__init__(self, name, grades, average):
        self.grade = grade
        self.average = average

        def __str__(self)
        return "Name {0}, Grade {1}, Average {3}".format (self.name, self.grade, self.average)def startalgorithm():
    student = []
    While True:
        student = input("Insert your name:" )
        if student[0] == "1": #i don't really know how to break a cycle off without having to write every number separately
            break

This is the part where I'm stuck at since I do not know if I am going on this the right way and I keep getting messages of invalid syntax, any hints?
 
Last edited:
Technology news on Phys.org
  • #2
You'll have to give more information about what loops you're using and what the error messages are, and then we can nudge you in the right direction.
 

What is the purpose of calculating student grades and averages in a Python program?

The purpose of this program is to automate the process of calculating student grades and averages, which can be time-consuming and prone to human error. By using a Python program, we can ensure accuracy and save time.

What are the key components needed for this Python program?

The key components needed for this program are: a list of student names, a list of their respective grades, and functions to calculate the average grade and assign letter grades.

How do I input the student names and grades into the program?

You can input the student names and grades either manually or by importing a CSV file. The program will prompt you for the necessary inputs and guide you through the process.

How does the program calculate the average grade?

The program calculates the average grade by taking the sum of all grades and dividing it by the total number of grades. This is known as the arithmetic mean.

What is the purpose of assigning letter grades in this program?

The purpose of assigning letter grades is to provide a more comprehensive evaluation of the student's performance. This can also help in identifying students who may need extra help or additional challenges.

Similar threads

  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
722
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
18
Views
2K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
2
Replies
41
Views
3K
Back
Top