Exercises 4/5/061. Consider the following incomplete Java program:public class Exercise1 { public static void main(String[] args) {}// end main}a. Write java statements that import the classes Scanner, FileReader, PrintWriter, and FileWriter from the packages java.util and java.io.b. Write statements that declare 2 file handles, one called inFile associated with the file “inData.txt”, and the other outFile associated with the file “outData.txt”.c. Write statements that declare an instance of Scanner to access the data stored in inFile.d. Write statements that declare an instance of PrintWriter to write data to thefile outFile.e. Suppose that the file inData.txt contains the following data:56 38A7 8f. Write statements so that after the program executes, the contents of the fileoutData.dat are as shown below. If necessary, declare additional variables.The sum of 56 and 38 = 94.The character that comes after A in the Unicode set is B.the product of 7 and 8 = 56.g. Write a statement that closes the output file.2. The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets --- box, sideline, premium, and general admission. After each game the data is stored in a file called tickets.dat in the following format:250 5750100 2800050 3575025 18750Your program will create a report file called sales.txt, which contains a report in the format:Weekly Ticket Sales ReportType Price #Sold Amount SoldBox 250.00 5750 1437500.00Sideline…………………………………PremiumGeneralTotal Number of Tickets Sold: (total sold)Total Sales: $ ( Sum of ticket
View Full Document