# Programming, Data Structures And Algo Using Python Assignment 5 Answers

Programming, Data Structures And Algo Using Python Assignment 5 Answers 2022:- In This article, we have provided the answers of Programming, Data Structures And Algo Using Python Assignment 5 You must submit your assignment to your own knowledge.

For this assignment, you have to write a complete Python program. Paste your code in the window below.

• You may define additional auxiliary functions as needed.
• In all cases you may assume that the input to your program has the expected format, so your program does not have to check for malformed inputs.
• There are some public test cases and some (hidden) private test cases.
• “Compile and run” will evaluate your submission against the public test cases.
• “Submit” will evaluate your submission against the hidden private test cases. There are 6 private test cases, with equal weightage. You will get feedback about which private test cases pass or fail, though you cannot see the actual test cases.
• Ignore warnings about “Presentation errors”.

The academic office at the Hogwarts School of Witchcraft and Wizardry has compiled data about students’ grades. The data is provided as text from standard input in three parts: information about courses, information about students and information about grades. Each part has a specific line format, described below..

Line format: Course Code~Course Name~Semester~Year~Instructor
Line format: Roll Number~Full Name

The possible grades are A, AB, B, BC, C, CD, D with corresponding grade points 10, 9, 8, 7, 6, 5 and 4. The grade point average of a student is the sum of his/her grade points divided by the number of courses. For instance, if a student has taken two courses with grades A and C, the grade point average is 8.50 = (10+7)÷2. If a student has not completed any courses, the grade point average is defined to be 0.

You may assume that the data is internally consistent. For every grade, there is a corresponding course code and roll number in the input data.

NPTEL Ethical Hacking Assignment 5 Quiz Answers 2022

Each section of the input starts with a line containing a single keyword. The first section begins with a line containing Courses. The second section begins with a line containing Students. The third section begins with a line containing Grades. The end of the input is marked by a line containing EndOfInput.

Write a Python program to read the data as described above and print out a line listing the grade point average for each student in the following format:

Code:-

``````def Gvalue(code):
if code=="A":
return(10)
if code=="AB":
return(9)
if code=="B":
return(8)
if code=="BC":
return(7)
if code=="C":
return(6)
if code=="CD":
return(5)
if code=="D":
return(4)

# varibles used for storing data

Roll_course_count={}
Roll_name={}

#COURSES INPUT SECTION

type_course=input()
enter_course_detail=input()
next_input=input()
while(next_input!="Students"):
next_input=input()

#STUDENT INPUT SECTION

#if it fails in courses section then
#it will automatically enter students

roll,name=input().split('~')
Roll_name[roll]=name
Roll_course_count[roll]=0
next_input=input()
while('~' in next_input):
roll,name=next_input.split('~')
Roll_name[roll]=name
Roll_course_count[roll]=0
next_input=input()

Roll_course_count[Rnum]=Roll_course_count[Rnum]+1
next_input=input()
while(next_input!="EndOfInput"):
Roll_course_count[Rnum]=Roll_course_count[Rnum]+1
next_input=input()

#print(Roll_course_count)
#print(Roll_name)

#RESULT COMPUTATION

Sort_roll=sorted(Roll_name)
for key in Sort_roll: