Grades, Easy

From Progzoo
Jump to navigation Jump to search
#Sample data for Easy questions 1-5
#One line per student. One grade per module
#Matric   	name    	RAD	SD1a	PS	IIS
05001001	Alpha, A	50	51	52	53
05001002	Bravo, B	40	41	42	43
05001003	Charlie, C	30	31	32	33
05001004	Delta, D	20	50	50	50
04001005	Echo, E.	50	20	50	50
04001006	Foxtrot, F	50	50	20	50
05001007	Golf, G.	50	50	50	20
05001008	Hotel, H	50	50	50	20

Each student takes four modules: RAD, SD1A, PS and IIS. The passing grade is 40% in every module.

The input data grades10.txt contains one line per student.

The line begins with the matriculation number and the name. The marks for each of the subjects are given in the sequence RAD, SD1a, PS and IIS. Each of these fields is separated by the tab character.

RAD pass list

Print the names of the students who have passed the RAD module.

Try adding an if statement, for example try replacing


with something like ...

if (iis<50)

[Font] [Default] [Show] [Resize] [History] [Profile]

Average grade

For each student print the name followed by the average grade over the four modules.

[Font] [Default] [Show] [Resize] [History] [Profile]

Semester pass list

Print the names of the students who have passed all four modules.

You need to print some names but not other. An if statement will do this.

[Font] [Default] [Show] [Resize] [History] [Profile]

Matric 04

Print the matriculation number and the name of the students who have a matriculation number that starts with 04.

[Font] [Default] [Show] [Resize] [History] [Profile]

Count SD1a fails

Line: 123 DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 51
Line: 123 DOMDocument::loadXML(): Premature end of data in tag question line 1 in Entity, line: 58