1.Provide one to two sentence answers to each of the followingquestions:
The header is a leftover of the copier, which scaned the carteidge into the rom file and it needs additinal data written at the beginning of the file. This is a nightmare, since all addresses are then shifted, but (for instance) the pointers point to the old locations, ignoring the header.
What happens if you try to open a file for reading that does notexist?
![Ami rom file doesn Ami rom file doesn](https://i.snag.gy/0png6G.jpg)
What happens if you try to open a file for writing that doesn'texist?
What happens if you try to open a file for writing on a devicethat is write-protected (such as a DVD-ROM)?
2.Provide printf statements foreach of the following. You should choose appropriate variable namesgiven the requirements:
Display the first 15 characters of a student's last name leftjustified, and the student's GPA to one decimal place. The namesand GPAs should line up properly in columns if you print multiplestudents.
Display a tax rate as a percentage to 2 decimal places, a totaldollar amount purchased for purchases up to $1,000,000.00 (includethe commas), and the amount of tax on that purchase (also indollars and cents with commas). Make sure that all of the amountsline up properly in columns.
3.Implement (i.e., write the body of) the following method,countLines, that takes a String as a parameter. The method shouldopen the file named by that String, count the lines in the file,close the file, and return the number of lines of text it found inthat file.
4.Implement a new version of thecountLines method that catches the possibleIOExceptionexception and outputs an error message if suchan exception is raised.