subject
Engineering, 27.01.2020 22:31 ericv6796

Hello, i am currently taking a course in data structures with python. here is my question:

in this assignment, we will develop an algorithm to calculate the final grade for a class of 15 students. there are 5 assignments (20 points each) as well a midterm and a final (100 points each). another 10 points are for in-class participation.

all the assignments and tests contribute to the final grade equally. additionally, the in-class participation (either thru discussions or in real-time) is also a part of the final grade.

what i have so far:

# steven ochoa
# assignment_1.py

class student:

name = ""
net_id = ""
final_grade = ""
let_grade = ""

# class constructor
def , name, net_id, final_grade, let_grade):
self. name = name
self. netid = net_id
self. final_grade = final_grade
self. letter_grade = let_grade

# print student-line
def print_student(self):
print(self. formattemplate. format(self. studentid, self. studentname, self. assignmentsum, self. midterm, self. final,
slef. participation, self. totalgrade, self. lettergrade))

def add_grades ():

# gathering grades for the 5 assignments
print("insert assignment grades (20 point scale): ")

assignment1, assignment2, assignment3, assignment4, assignment5 = eval(input("enter your assignment grades: "))

# total grade for assignments

total = (assignment1+assignment2+assignment 3+assignment4+assignment5)

# gathering grades for the mid-term and the final
print("insert exam grades (100 point scale): ")

mid_term = eval(input("midterm grade: "))
final = eval(input("final grade: "))

# exam average
exam_average = (final + mid_term)/2

# participation points
print("insert participation grade (10 point scale) : ")

participation = eval(input("participation: "))

# final grade report
final_grade = (total*0.45) + (exam_average*0.45) + participation

return final_grade

def letter_grade(final_grade):

# calculates the letter grade
str(final_grade)

if final_grade > 100:
return "error! "
if 100 > = final_grade > 89:
return "final grade: ", final_grade, "a"
if 89 > = final_grade > 79:
return "final grade: ", final_grade, "b"
if 79 > = final_grade > 69:
return "final grade: ", final_grade, "c"
if 69 > = final_grade > 59:
return "final grade: ", final_grade, "d"
if 59 > = final_grade > 0:
return "final grade: ", final_grade, "f"
if 0 > final_grade:
return "error! "

def main(letter_grade, final_grade):

# introduction to the program
print("this program calculates your final grade.")

# set up loop for multiple students
student_list = []
another_student = "yes"

while another_student == "yes":
# adding another student
# gathering student information
name = input("what is the student's name? : ")
net_id = input("what is the student's net-id? : ")

f_grade = add_grades
let_grade = letter_grade(final_grade)

studentlist. append[(name, net_id, f_grade, let_grade)]
another_student = input("add another student? enter yes or no")

# create a header
# print table in a loop
for student in range(5):
print("student name: ", name, "net-id: ", net_id, "final grade: ", f_grade, "letter grade: ", let_grade)
print()
main()

the program runs, but it messes up after i input the student id.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 19:20
Air enters a horizontal, constant-diameter heating duct operating at steady state at 290 k, 1 bar, with a volumetric flow rate of 0.25 m°/s, and exits at 325 k, 0.95 bar. the flow area is 0.04 m2. assuming the ideal gas model with k = 1.4 for the air, determine (a) the velocity at the inlet and exit, each in m/s, and (c) the rate of heat transfer, in kw flow rate, in kg/s, (b) the mass kg 0.3
Answers: 2
question
Engineering, 04.07.2019 19:20
Determine the time of the day and month of the year at which the peak sensible cooling load occurs for a top floor, north-eastern corner room of an office building in durban for the following conditions: floor area: 8 x 8 x 3 m east and north walls: 115 mm face brick (outside), 20 mm air space, 115 mm ordinary brick (inside) with 15 mm plaster roof construction: suspended plasterboard ceiling, 450 mm air space, 150 mm concrete, 75mm screed, waterproofing no heat transfer across other surfaces window area 3x 1,5 m high in north wall only. ordinary glass with venetian blinds. lights and occupants : from 07: 00 to 18: 00 average light density: 25 w/m2 number of occupants : 5 seated, light office work room temperature 24°c
Answers: 3
You know the right answer?
Hello, i am currently taking a course in data structures with python. here is my question:
Questions
question
Biology, 22.09.2020 19:01
Questions on the website: 13722361