Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2 Back to the basics! Write a program that asks the user the number of courses he is taking this semester, then asks the

image text in transcribedimage text in transcribed

Exercise 2 Back to the basics! Write a program that asks the user the number of courses he is taking this semester, then asks the user to enter the course codes and grades, and finally prints the average of the grades this semester. No need for input validation in this exercise! Sample run: Enter the number of courses that you are taking this semester: 4 Enter the course code for course W1: CoNm1020 Enter the grade obtained in com1020: 92 Enter the course code for course 2 2: INFS1201 Enter the grade obtained in INFS1201: 78 Enter the course code for course \#3: INFT1201 Enter the grade obtained in INFT1201: 96 Enter the course code for course \#4: MATH1030 Enter the grade obtained in MATH1030: 86 Your average for this semester is: 88.6 Exercise 3 Actually, not all courses have the same weight: the weight depends on the credit value. Modify the previous code to request the credit value of each course and compute the weighted average: the weighted average represents the sum of the grades multiplied by their credit value divided by the sum of all credits. Here is a sample run: Enter the number of courses that you are taking this semester: 4 Enter the course code for course \#1: CoNm1020 Enter the number of credits of comm1020: 3 Enter the grade obtained in Comm1020: 92 Enter the course code for course W2: INFS1201 Enter the number of credits of INFS1201: 4 Enter the grade obtained in INFS1201: 78 Enter the course code for course \#3: INFT1201 Enter the number of credits of INFT1201: 4 Enter the grade obtained in INFT1201: 96 Enter the course code for course \#4: MATH1030 Enter the number of credits of MATH1030: 3 Enter the grade obtained in MATH1030: 86 Your average for this semester is: 87.85714285714286 Exercise 4 At UDST, the GPA is a weighted average, not of the grades directly but of grade points. Grade points are converted from grades According to the below table: Add to the previous code, a function grade2GP that takes a grade as input and returns the corresponding grade point. Use this function to compute the semester GPA. Here is a sample run: Enter the number of courses that you are taking this semester: 4 Enter the course code for course \#1: COMM1020 Enter the number of credits of COMM1020: 3 Enter the grade obtained in CoMM1020: 92 Enter the course code for course \#2: INFS1201 Enter the number of credits of INFS1201: 4 Enter the grade obtained in INFS1201: 78 Enter the course code for course \#3: INFT1201 Enter the number of credits of INFT1201: 4 Enter the grade obtained in INFT1201: 96 Enter the course code for course \#4: MATH1030 Enter the number of credits of MATH1030: 3 Enter the grade obtained in MATH1030: 86 Your semester GPA is: 3.4642857142857144

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago

Question

Who will manage the project and liaise with the external providers?

Answered: 1 week ago

Question

How will we measure their success and effectiveness?

Answered: 1 week ago