Question: In JAVA, Write a program that reads data from an input file and writes a report to an output file. The input data will be
In JAVA, Write a program that reads data from an input file and writes a report to an output file.
The input data will be veterinary data. The output will be a report of the cost of one visit to the vet for one pet. See below for both the input file format and the report format.
1) Report column specifications. Define the columns in the printf statements that generate the report such that they are wide enough to hold data at least as large as the data that appears in the sample input file below. All data in each column should be properly lined up
The name column should be left justified and the other columns should be right justified.
Ask the user to enter the name of both the input and output files. Whatever names they enter at the command line during execution should be used for input and output.
File Format
Sample Input File (Visit.txt)
Andrea Rodriguez
9
3
2018
Snickers
Dog
Male
7
Rabies Shot
20.00
1
true
0.75
Distemper/Parvo Combo
45.00
1
false
0.0
Physical Therapy
100.00
2
true
.5
Microchip
19.00
1
false
0.0
Neutering
200.00
1
true
.8
X ray
200.00
3
true
.9
Overnight Stay
200.00
2
true
.8
Sample File Output (Report.txt)
Pet Veterinarian Visit Report
-----------------------------
Veterinarian: Andrea Rodriguez
Date : 09/03/2018
Pet Name : Snickers
Pet Species: Dog
Pet Gender : Male
Procedures
Name Price Qty Amount Is Covered Pct Covered Amount Covered Amount Due
---- ----- --- ------ ---------- ----------- -------------- ----------
Rabies Shot 20.00 1 20.00 true 0.75 15.00 5.00
Distemper/Parvo Combo 45.00 1 45.00 false 0.00 0.00 45.00
Physical Therapy 100.00 2 200.00 true 0.50 100.00 100.00
Microchip 19.00 1 19.00 false 0.00 0.00 19.00
Neutering 200.00 1 200.00 true 0.80 160.00 40.00
X ray 200.00 3 600.00 true 0.90 540.00 60.00
Overnight Stay 200.00 2 400.00 true 0.80 320.00 80.00
---- ----- --- ------ ---------- ----------- -------------- ----------
Total 1484.00 1135.00 349.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
