text file called attendance.txt which records the student daily attendance for Class A and B. Day ClassA ClassB 1 50 38 2 48 40 3 44 36 Write C statements to perform the following: -Declare two file pointers named fp1 and fp2. -Open the attendance.txt text file for reading using fp1 file pointer. If the file is not opened successfully, display an error message “File opening errors” and exit the program. -Open the attnAverage.txt text file for writing using fp2 file
text file called attendance.txt which records the student daily attendance for Class A and B. Day ClassA ClassB 1 50 38 2 48 40 3 44 36 Write C statements to perform the following: -Declare two file pointers named fp1 and fp2. -Open the attendance.txt text file for reading using fp1 file pointer. If the file is not opened successfully, display an error message “File opening errors” and exit the program. -Open the attnAverage.txt text file for writing using fp2 file
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.5: A Case Study: Pollen Count File Update
Problem 5E
Related questions
Question
Consider the following contents of a text file called attendance.txt which records the student daily attendance for Class A and B.
Day ClassA ClassB 1 50 38 2 48 40 3 44 36 |
Write C statements to perform the following:
-Declare two file pointers named fp1 and fp2.
-Open the attendance.txt text file for reading using fp1 file pointer. If the file is not opened
successfully, display an error message “File opening errors” and exit the program.
-Open the attnAverage.txt text file for writing using fp2 file pointer.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 5 images
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT