1. C++.
Assume that
gradeData
is an
fstream
object, write a statement that opens the file
grades.dat
for output. (
Note: the file is located in the following folderc:Usersjohn
Documents
).
2.
Assume that
diskInfo is an fstream object, write a statement that opens thefile
students.txt for output, where all output will be written to theend of the file.
3.
Write a program that asks the user for the name of a file. Theprogram should display
the first 10 lines of the file on the screen (the “head” of thefile). If the file has
fewer
than 10 lines, the entire file should be displayed, with amessage indicating the entire file has been displayed.
Someone please answer these questions in C++
OR
OR