In the US Higher Education sector, a degree is classified using a Grade Point Average (GPA). The grades ‘A’, ‘B’, ‘C’, ‘
Posted: Fri Jul 01, 2022 5:34 am
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.
>> Create 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.
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.
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.
>> Create 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.
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.