CSE 234: Lab Final Exam

Opened: Wednesday, 9 December 2020, 1:00 PM
Due: Wednesday, 9 December 2020, 3:15 PM
Make a submission

1. Write a python program that will take an integer as input, and will determine whether the number is prime or not.

Sample Input

Sample Output

23

23 is a prime number

44

44 is not a prime number

2. Suppose, there are two students who belong to CSE, and SWE departments respectively. Now, the student class will contain an attribute named student_id which will be accessible to all. The CSE and SWE classes will contain two attributes named cgpa, and credit_hours_completed, along with three methods named calculate_completed_credit, calculate_course_grade, and calculate_cgpa

 

The student class constructor will show the student id, provided by the object. The CSE and SWE class constructors will show the department names accordingly upon the object creation.

 

The calculate_completed_credit will take the number_of_courses as an input parameter and the method will take credit hours of each course as inputs inside the method. The sum of all the credit hours will be returned.

 

The calculate_course_grade will take two parameters as inputs: course_credit, and achieved_course_grade. This method will multiply the course_credit and achieved_course_grade parameters and return the multiplied value

 

The calculate_cgpa method will take two parameters: the return value from the calculate_course_grade method, and the return value from the calculate_completed_credit method. This method will return the cgpa utilizing these parameters according to the standard CGPA calculation formula.

 

Now, write a python program that will solve the problem according to the given scenario.

 

Sample Input

Sample Output

191-15-12345

Enter no. of courses: 2

Enter credit hour-1: 3.0

Enter credit hour-2: 1.0

Enter course credit-1: 3.0

Enter course grade-1: 3.75

Enter course credit-2: 1.0

Enter course grade-2: 2.5

Student Id: 191-15-12345

Department: CSE

Total Completed Credits: 4.0

Course-1 Grade * Hour: 11.25

Course-2 Grade * Hour: 2.5

CGPA: 3.44

191-15-56789

Enter no. of courses: 2

Enter credit hour-1: 4.0

Enter credit hour-2: 1.5


Enter course credit-1: 4.0

Enter course grade-1: 4.0

Enter course credit-2: 1.5

Enter course grade-2: 3.5

Student Id: 191-15-12345

Department: SWE

Total Completed Credits: 5.5

Course-1 Grade * Hour: 16.0

Course-2 Grade * Hour: 5.25

CGPA: 3.86

N.B. You should submit 2 (.ipynb) files as the submission files. No need to handwrite the answers.