In the US Higher Education sector, a degree is classified using a Grade Point Average (GPA). The grades 'A', 'B', 'C', '

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In the US Higher Education sector, a degree is classified using a Grade Point Average (GPA). The grades 'A', 'B', 'C', '

Post by answerhappygod »

In the US Higher Education sector, a degree is classified usinga Grade Point Average (GPA).
The grades 'A', 'B', 'C', 'D' or 'F' are called academic grades.Each 'A' is worth 4 points, each 'B' is worth 3 points, each 'C' isworth 2 points, each 'D' is worth 1 point and each 'F' is worth 0points. The GPA is found by calculating the number of points andthen dividing by the number of academic grades. A student may alsohave a non-academic grade of 'W' (for withdrew) which is notcounted at all in the calculation.
You can assume that the student will have at least one academicgrade in their list of grades.
There are many ways of calculating a GPA from a list of grades,but you must follow the algorithm given by this top-leveldecomposition:
> Find GPA.
>> Input a list of academic and non-academic grades.
>> make a new list that consists of the number of pointsfor each academic grade in the input list.
>> Add up the values in the new list and divide by thenumber of values in the new list.
>> Print the result rounded to 2 decimal places.
One of the tests for your completed program will consist of theinput list
['D', 'A', 'B', 'B', 'C', 'D', 'B', 'F', 'W', 'B', 'W', 'C','?']
Where the final grade, represented here by '?' should bereplaced by a grade determined from the first digit in your PInumber. [Your PI number is the long number that starts with aletter, followed by either seven digits or six digits and anX].
If the first number in your PI number is 0, the missing gradeshould be 'A'.
If the first number in your PI number is a non-zero even number,the missing grade should be 'B'.
If the first number in your PI number is odd, it should be'C'.
The first task in the top-level decomposition is to produce alist that contains the points for each academic grade. So, forexample, for the list shown above, output should be
[1, 4, 3, 3, 2, 1, 3, 0, 3, 2, ?]
Where the ? is a 4, 3 or 2, depending on the grade determinedfrom your PI number.
a.In this part you will consider only this part of the top-levelalgorithm:
>> Input a list of academic and non-academic grades.
>> Create a new list that consists of the number of pointsfor each academic grade in the input list.
b.In this part of the question, you will take the output fromthe first task and write an algorithm and matching code to performthe second task, which is to calculate and print out the GPArounded to 2 decimal places. So, for the test input
[1, 4, 3, 3, 2, 1, 3, 0, 3, 2, 2]
The output would be 2.18
i.Identify which of the TM112 pattern or patterns could best beapplied to the solution of the second task. State clearly the nameof the pattern and the pattern number, for example "List generationPattern 2.2". A list of all the patterns can be found in theProblem solving and Python quick reference.
ii.Note down the expected output for both the list based on yourPI and the other test input you specified in a.iii
iii.Note an algorithm based on the pattern you haveidentified.
iv.Implement your algorithm as Python code. This must match thesteps of your algorithm and you should use comments in the code tomake it clear how the two correspond. Marks will be lost if theprogram does not follow the algorithm. Copy your Python code forthis second task into your Solution document.
c.Make a completed program that performs the whole task and copythis into your solution document. Paste in a screenshot of theoutputs in the shell when you run this Python file with the inputlist based on your PI number and with the test input list youidentified in a.iii
d.There are many ways of solving the original problem ofcalculating a GPA from a list of grades. Write a differenttop-level decomposition for solving this same problem.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply