Question: Part1: Write a python program to read the following XML file (shown in Figure1). Read the score of each class from score_data.xml, compute the GPA.
Part1:
Write a python program to read the following XML file (shown in Figure1).
Read the score of each class from score_data.xml, compute the GPA.
Add a gpa attribute for each class element.
Write the updated xml into a new file: output.xml (shown in Fiture2)
Upload your python source code file.
|
|
Figure 1: score_data.xml
|
|
Figure 2: output.xml
Part 2:
Write a python program to read the XML file output.xml (shown in Figure2).
Add 5 to each classs score, compute the GPA.
Compute the average GPA.
Add average element for average GPA of each student.
Write the updated xml into a new file: new_output.xml (shown in Fiture3)
|
|
Figure 3: new_output.xml
| GPA | Percentage | Grade | GPA | Percentage | Grade |
| 4.5 | 90-100 | A+ | 2.5 | 67-69 | C+ |
| 4.0 | 85-89 | A | 2.3 | 63-66 | C |
| 3.7 | 80-84 | A- | 2.0 | 60-62 | C- |
| 3.3 | 77-79 | B+ | 1.0 | 50-59 | D |
| 3.0 | 73-76 | B | 0.0 | <50 | E |
| 2.7 | 70-72 | B- |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
