Studybuddy24/7
Badges: 11
Rep:
?
#1
Report Thread starter 10 months ago
#1
can someone please help me with this code im not sure how to complete it i put the task and what i have done:

thank you so much

Portfolio grade challenge
Difficulty: 
Write a program that inputs a mark from the keyboard for sections of a project: ‘analysis’, ‘design’, ‘implementation’ and ‘evaluation’. The program should output the total mark, the grade, and how many more marks were needed to get into the next mark band.

Grades are:
<2 U
2 1
4 2
13 3
22 4
31 5
41 6
54 7
67 8
80 9



what i have done:



analysis = int(input("enter grade for analysis paper"))
design = int(input("enter grade for design paper"))
implementation = int(input("enter grade for implemation paper"))
evaluation = int(input("enter grade for evaluation paper"))

total = analysis + design + implementation + evaluation

print ("your total mark is", total)

if total < 2 :
print ("grade U")

elif total < 4 :
print ("grade 2")

elif total < 13 :
print ("grade 3")

elif total < 22 :
print ("grade 4")

elif total < 31 :
print ("grade 5")

elif total < 41 :
print ("grade 6")

elif total < 54 :
print ("grade 7")

elif total < 67 :
print ("grade 8")

elif total < 80 :
print ("grade 9")
0
reply
sdr981
Badges: 10
Rep:
?
#2
Report 10 months ago
#2
Sorry, I rewrote quite a lot of it

Let me know if there's something you don't understand. I recommend using the pastebin link at the bottom, as it's formatting is much better.

analysis = int(input("Enter grade for analysis paper: "))
design = int(input("Enter grade for design paper: "))
implementation = int(input("Enter grade for implemation paper: "))
evaluation = int(input("Enter grade for evaluation paper: "))

total = analysis + design + implementation + evaluation

print ("Your total mark is ", total)

grades = [2,4,13,22,31,41,54,67,80]

grade = 1

for boundary in grades:
if total >= boundary:
grade = grades.index(boundary)

if grade == 1:
print('Grade: U')
else:
print('Grade: ' + str(grade + 1))

if grade == 8:
print("You couldn't get a higher grade, well done!")
else:
print("You needed another " + str(grades[grade + 1] - grades[grade]) + " marks to get the next grade.")


https://hastebin.com/jiyadopebi.pl
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Norwich University of the Arts
    Postgraduate Open Day Postgraduate
    Thu, 23 Jan '20
  • SOAS University of London
    Development Studies, Interdisciplinary Studies, Anthropology and Sociology, Languages, Cultures and Linguistics, Arts, Economics, Law, History, Religions and Philosophies, Politics and International Studies, Finance and Management, East Asian Languages & Cultures Postgraduate
    Sat, 25 Jan '20
  • University of Huddersfield
    Undergraduate Open Day Undergraduate
    Sat, 25 Jan '20

How are your mock exams going?

Love them - Feeling positive (13)
7.1%
They've been reasonable (76)
41.53%
Not feeling great... (47)
25.68%
They are TERRIBLE! (47)
25.68%

Watched Threads

View All
Latest
My Feed