Question: Write a Java Program according to this question. And make some explanations for key steps, it's important to me, thanks Given is a UML diagram

 Write a Java Program according to this question. And make some

Write a Java Program according to this question. And make some explanations for key steps, it's important to me, thanks

Given is a UML diagram for a class known as ReadSales. The class contains data fields infile and outfile of type java.io. File. It also contains constructors and methods. caleAnnualsales() method calculates the number of annual cars sold by adding the number of cars sold for every 4 quarterly years Q1, Q2, Q3 and Q4 as given in the infile input file. Each line in the infile contains the Staffid followed by the number of cars sold each quarterly year and separated by whitespace characters. The calcAnnualsales () method also prints a bonus in the eutput outfile output file. The format of each line of the outfile output file contains the StaffID followed by the annual car sales amount and then the bonus amount. Each of the three data will be separated by whitespaces characters. The getBonus () method will obtain annual bonus based on the given bonus table in Table 1. Examples of the Input and Output File formats are as follows: Dr. Jamilah Din Leb6 You are required to: a) Implement the ReadSales class. b) Implement a GetBonus program that contains main method to test ReadSales class. This class will create a File object for an input file named CarSales . txt contained in the directory C:\My Document \, and a File object for an output file named Bonus . txt generated in the directory C:\MyDocument\. This program will create ReadSales objects for the created File objects. This program will calculate the annual car sales from the information contained in Carsales.txt and print the Staffid, annual car sales and bonus into an output file called Bonus.txt by invoking calcAnnualsales () method. Your program should have exception handling to determine the existence of the input file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!