Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Java statements that import theclassesScanner,FileReader,andPrintWriterfrom thepackagesjava.utilandjava.io . b . Write statements that declareinFileto be a reference variable of typeScannerandoutFileto be a reference variable of

Write Java statements that import theclassesScanner,FileReader,andPrintWriterfrom thepackagesjava.utilandjava.io.b.Write statements that declareinFileto be a reference variable of typeScannerandoutFileto be a reference variable of typePrintWriter.c.The program will read data from the fileinData.txtand write output tothe fileoutData.dat. Write statements to open both these files, associateinFilewithinData.txt, and associateoutFilewithoutData.dat.d.Suppose that the fileinData.txtcontains the following data:10.205.3515.6Randy Gill 31185003.5AThe numbers in the first line represent the length and width, respectively,of a rectangle. The number in the second line represents the radius of acircle. The third line contains the first name, last name, and the age of aperson. The first number in the fourth line is the savings account balanceat the beginning of the month and the second number is the interest rateper year. (Assume thatp3.1416.) The fifth line contains an uppercaseletter betweenAandY(inclusive). Write statements so that after theprogram executes, the contents of the fileoutData.txtare as shownbelow. If necessary, declare additional variables. Your statements shouldbe general enough so that if the content of the input file changes and theprogram is run again (without editing and recompiling), it outputs theappropriate results.Rectangle:Length =10.20, width =5.35, area =54.57, parameter =31.10Circle:Radius =15.60, area =764.54, circumference =98.02Name: Randy Gill, age: 31Beginning balance = $18500.00, interest rate =3.50Balance at the end of the month =$18553.96The character that comes after A in the ASCII set is Be.Write the statement that closes the output file.f.Write a Java application program that tests the Java statements that youwrote in parts ae.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions