You are on page 1of 2

Name: ________________________________

ID: ________________________________

Semester: ________________________________

EE 209 Computing for Engineers


Lab 4: Structures

Objectives:
To be familiar with using structures and arrays of structures.

Equipment/Apparatus:
PC with C++ compiler

Question

A file named EE209_Marks.txt consists the name of six students and their marks scored in
three tests as shown in the following chart.
Ahamad 15.5 17.5 12
Susan 14.5 18.5 16
Dinesh 12.5 14.5 17
Omar 12 14 16
Lee 15 17 16
John 16 16.5 15.5

Write a C++ program declaring suitable structure data type and read the file contents. Then
your program should calculate the total test marks for each student, average marks for each
test and store the result in a file called EE209_results.txt as well as display on the console.
Your program should also store the highest and lowest mark scored in each test and the
average of the total test marks scored by all the students to the file as well as display on the
console

Sample Output is shown in the next page.


Sample Output

You might also like