Question: Write a program to calculate the surface area and volume of a circular cylinder using file input and output. . The user is prompted for

 Write a program to calculate the surface area and volume of

Write a program to calculate the surface area and volume of a circular cylinder using file input and output. . The user is prompted for the filenames of the input file and the output file. . Each line of the input file has an 8 digit id number, the radius, and the height of a cylinder, each separated by spaces. . Each line of the output file must have the same 8 digit id number, followed by the surface area, and volume of the cylinder, each separated by spaces. The values must be round to two decimal places * The program must open the files specified by the user and process the data. When it is done the program displays the number of cylinders processed. . The formula for the surface area is: 2Trh + r). . The formula for the volume is: Trh. For the value of TT you can use the Math.Pl constant by importing java.lang.Math. Attached to this assignment are two file: sample.txtand data.txt. You can use sample.txtto test your program. The user interaction should look something like this: Enter sle name input file: sampie.txt Enter file name of output file: output.txt Done procesaing 5 entries The input file is: (sample.tct) 00000001 00000002 00000003 00000004 00000005 18.4 20.7 13.9 18. 22.6 23.0 18.7 31.7 24.9 22.5 The output file is: (output.td) 00000001 00000002 00000003 00000004 00000005 4786.28 5124.44 3982.53 5083.73 6404.20 24463.21 25172.84 19241.49 27062.95 36103.50 For this assignment, you should do the the normal submission using the Program Submission Template. However, you should also attach the output file generated (as a tet file) when processing data.tot data.txt sample.txt

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!