Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python like functions, lists, tuples, dictionaries, strings, etc.image text in transcribed

Question 2. Write a program that will repeatedly take (for a student) input of this type: course_no, number_of_credits, and grade_received (eg. CSE101 4 A). These inputs are for the courses the student has done in the semester. If no input is given (i.e. just a return), that means no courses are left. From this data, print the transcript for the semester for the student as: Course_no: grade Course_no: grade SGPA: n.nn (two decimal places) In the transcript, the records should be printed such that they are sorted by the course_no (hint: when sorting a list of tuples/lists, the default sorting is with the first element of the tuple/list). The course numbers are an alphanumeric string with capital letters in the start and digits at the end (e.g. CSE101, CSSS21), credits can be 1,2 or 4 , and grade can be A+(10),A(10),A(9), B(8),B(7),C(6),C(5),D(4),F(2) (the number in () is their numeric equivalent for SGPA calculation.) The SGPA is computed as (sum of: credits grade/ total_credits). If any input is not valid, print a suitable message ("improper course no", "incorrect credit", or "incorrect grade") and ignore that input. Suggestions: A list of tuples/lists may be a good structure to use. Read the input as tuples into a list. When inputs are done, process the list. First just write code to read the input, split it into a list, and pass it to a function to check for errors (recall string has operations like isdigit() to check if the string is integer). If input is valid, add to a list of tuples (initially, to check the course name structure just check if it is an alphanumeric string - later write a function to check its valid structure - requires a bit of logic). Independently write a function which, given a list of tuples, can compute the SGPA. Then combine the two

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions