Programming Lab 9: - File I/O
Programming Lab 9: - File I/O
Task 1
Consider a file called student.txt containing the name and exam
scores of 20 students in a class (the contents of the file is given right).
Write a C++ program to perform the following tasks:
a) Read the data from the file into suitable vectors.
b) Output the mean score for each exam (sum vertically each score column).
c) Output the name of the student with the highest overall score (sum horizontally
applying the weights 30%, 30%, and 40% for each column respectively).
student.txt
UGUR
KADIR
SEMIH
GOZDE
FIRAT
EDA
FULYA
GUL
EMRE
AHMET
ISMAIL
MELIKE
TANER
SEHER
ALI
EMIN
HAVVA
FERDA
MUKRIME
TUGBA
67
72
00
73
30
51
41
67
30
76
67
71
59
79
90
88
76
10
54
61
38
45
71
70
69
58
65
69
40
41
15
65
50
51
88
92
85
25
15
70
Task 2
The lifetime of a food is distributed according to the Rayleigh distribution:
(http://en.wikipedia.org/wiki/Rayleigh_distribution)
55
60
45
61
35
67
73
70
84
67
59
61
58
65
72
78
80
50
12
66