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.

60

70

85

90

66

78

62

88

89

77

80

50

Figure 1: score_data.xml

60

70

85

90

66

78

62

88

89

77

80

50

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)

65

70

90

95

71

78

67

93

94

82

85

55

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!