Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions 4, 5, 6 - This statement is for the next three problems. and to be solved in python only Goal is to develop an

Questions 4, 5, 6 - This statement is for the next three problems. and to be solved in python only

Goal is to develop an application for grading in courses at IIIT-Delhi. The application should provide for (i) creating a course for grading with its name, credits, list of assessments with percentage weight for each (e.g. [("quiz", 5), ("mid-sem", 15), ], a grading policy as a list percent for different grades (we will assume that only grades are: A, B, C, D, and F, so this can be [80, 65, 50, 40, 30] (i.e. A above 80, B between 80 and 65, , F below 30). However, the final cutoff for each grade will be within +/- 2 of the percent specified (i.e. for A it will be between 78 and 82) - it will be the higher of two consecutive marks within this range which have the highest difference. (So, if the marks are 81.9, 81.8, 81.7, 81, 80.9, 80.8, then the cutoff will be midpoint of 81.7 and 81, which has a largest gap (ii) adding students' marks for all assessments given in a file - these will be rollno followed by marks for each. Once marks are given, it should do the grading - apply the policy to determine the grade for each student.

Change to: [80, 65, 50, 40] (i.e. A above 80, B between 80 and 65, , F below 40)

It should then ask the professor what he wants to do: 1. Generate a summary - which should print the course info (name, credits), assessments and their weight, cutoffs for different grades, and grading summary (how many As, how many Bs, etc) 2. Print the grades of all the students in a file as: rollno, total marks, grade (one line for each student). 3. Search for a student record - given the roll no, show marks in different assessments, total marks, and final grade.

Develop this program and use it for grading the "IP" course. The assessments and the grading policy is given below (in the main program steps)

The main program can be something like (rough sketch):

cname, credits = "IP", 4

assessments = [("labs", 30), ("midsem", 15), ("assignments", 30), ("endsem", 25)]

policy = [80, 65, 50, 40, 30]

create-IP course (cname, credits, assessments, policy)

Upload-marks data - call a function/method with input as marks.txt

doGrading - call a function/method

Loop asking for what operation (1, 2, 3); perform the operation till no input given

Question 4. Write this program using class and objects - it seems that "Course" and "Student" will be natural classes. Write this program using classes and objects. You must have at least two main classes for course and student.

Question 5. Write this program without using classes and objects. (You may find dictionaries as suitable data structure.) Do the same problem without using oop.

Question 6. Compare the two approaches/code: (A): In your view what are the two pros and cons of the two approaches. (B Compare the performance of these two in terms of time taken. For this, use the package time. For measuring time taken, run the grading operation N (say 1000) number of times, and run searching for student N number of times (you can pick up a roll no randomly, or just give a few roll nos in a list and go through them repeatedly) and then compute the time for the two, summarizing which one is faster for (i) grading operation, and which one for (ii) search operation and by how much (takes what fraction of time of the other)

The answer to this question should be be in a .txt file, containing:

Advantages of using OO

1.

2.

Advantages of using Dictionaries

1.

2.

Disadvantage of using OO

1.

2.

Disadvantage of using dictionaries

1.

2.

Performance comparison for grading operation (give in each line: value of N; time taken by two approaches in seconds, and which is faster and by how much).

1. N:

2. Time by OO:

3. Time by dictionary:

4. X is faster; fraction of time x took is:

Performance comparison for search operation (give in each line: value of N; time taken by two approaches in seconds, and which is faster and by how much).

1. N:

2. Time by OO:

3. Time by dictionary:

4. X is faster; fraction of time x took is:

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

Step: 3

blur-text-image

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions