Write a program that reads a file in.txt containing marks of 5 students. The program calculates the student's carry-mark as the average mark of Test 1 and Test 2. The program also determines the average of the class. The display of results must be in an output file called out.txt.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
QUESTION 1
Write a program that reads a file in.txt containing marks of 5 students. The program calculates the
student's carry-mark as the average mark of Test 1 and Test 2. The program also determines the
average of the class. The display of results must be in an output file called out.txt.
Data in a file in.text
Name
Test 1
Test 2
Paula
65
68
Georgio
70
78
Rafael
85
80
Marla
91
79
Alfreedo
23
59
Sample output file:
Name
Test 1
Test 2 Carry-Mark
Paula
65
68
66.5
Georgina
70
78
74
Rafael
85
80
82.5
Marla
91
79
85
Alfreedo
23
59
41
Average: 69.8
Transcribed Image Text:QUESTION 1 Write a program that reads a file in.txt containing marks of 5 students. The program calculates the student's carry-mark as the average mark of Test 1 and Test 2. The program also determines the average of the class. The display of results must be in an output file called out.txt. Data in a file in.text Name Test 1 Test 2 Paula 65 68 Georgio 70 78 Rafael 85 80 Marla 91 79 Alfreedo 23 59 Sample output file: Name Test 1 Test 2 Carry-Mark Paula 65 68 66.5 Georgina 70 78 74 Rafael 85 80 82.5 Marla 91 79 85 Alfreedo 23 59 41 Average: 69.8
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning