you will take the output from the first task and write an algorithm and matching code to perform the second task, which is to calculate and print out the GPA rounded to 2 decimal places.
you will take the output from the first task and write an
[1, 4, 3, 3, 2, 1, 3, 0, 3, 2, 2]
The output would be 2.18
output from 1st task is in photo
Identify which pattern or patterns could best be applied to the solution of the second task. State clearly the name of the pattern and the pattern number, for example “List generation Pattern 2.2
Pattern 4.1 Formula
Pattern 4.2 Case analysis (two cases))
Pattern 4.3 Case analysis (multiple cases)
Pattern 4.4 Case analysis (nested cases)
Pattern 4.5 Sequence generation
Pattern 2.2 List generation
Pattern 2.3 List filtering
Pattern 2.4 List transformation
Pattern 2.5 Reduction: counting
Pattern 2.6 Reduction: aggregation
Pattern 2.7 Reduction: find value
Pattern 2.8 Reduction: find best value
Pattern 2.9 Reduction: version 3 find position of first best value
![choice = 'Y'
while choice != 'N':
num_of_grades = int(input(
"Enter number of grades you want to enter: ")) # asking user number of grades including
# academic and non-academic
grades = [] # list to store entered grades
grades_numeric_value = [] # list to store the numeric value of grades
#looping and storing the input and its numeric value
for i in range(num_of_grades):
grades. append(input("Grade: "))
# different cases of Grades
if grades[i] == 'A':
grades_numeric_value.append(4)
elif grades[i] == 'B':
grades_numeric_value.append(3)
elif grades[i] == 'C':
grades_numeric_value.append(2)
elif grades[i] == 'D':
grades_numeric_value.append(1)
elif grades[i] == 'F':
grades_numeric_value.append(0)
#we have not written case for W grade because it is non-academic grade
#appending 'C' as according to id, first digit is '1' which is odd so, as per question add 'C'
grades. append('C')
grades_numeric_value.append(2) # adding numeric value
# calculating total grade point using sum function
total_grade_point = sum(grades_numeric_value)
gpa = total_grade_point / len(grades_numeric_value) # calculating GPA by dividing total with num of
grades
print("Grades: ", grades) # displaying all grades
print("Grade points: ", grades_numeric_value) # displaying grade point of academic courses
print("Your total GPA is : {:.2f}".format(gpa)) # printing GPA
print("Do you want to calculate another GPA? (Y = yes / N = no)") # asking user if he wants to calculate
again
choice = input() # storing input
print("Thank You!") # greeting](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F43441e92-b7c8-4599-b90d-2666dd4e233a%2F3474f81e-c721-4f37-8ad0-9e28da4d5dfa%2F5lq8a5u_processed.png&w=3840&q=75)

Step by step
Solved in 2 steps with 4 images

experts need to read the question correctly you are not been asked for code or an
Identify which pattern or patterns could best be applied to the solution of the second task. State clearly the name of the pattern and the pattern number, for example “List generation Pattern 2.2
Pattern 4.1 Formula
Pattern 4.2 Case analysis (two cases))
Pattern 4.3 Case analysis (multiple cases)
Pattern 4.4 Case analysis (nested cases)
Pattern 4.5 Sequence generation
Pattern 2.2 List generation
Pattern 2.3 List filtering
Pattern 2.4 List transformation
Pattern 2.5 Reduction: counting
Pattern 2.6 Reduction: aggregation
Pattern 2.7 Reduction: find value
Pattern 2.8 Reduction: find best value
Pattern 2.9 Reduction: version 3 find position of first best value
please read correctly before you answer intead of wasting peoples questions








