Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following incomplete Java program:public classCh 3 _ PrExercise 1 { public static voidmain ( String [ ] args ) { . . .
Consider the following incomplete Java program:public classChPrExercisepublic static voidmainStringargs Write Java statements that import theclassesScanner,FileReader,andPrintWriterfrom thepackagesjava.utilandjava.iobWrite statements that declareinFileto be a reference variable of typeScannerandoutFileto be a reference variable of typePrintWriter.cThe 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.dSuppose that the fileinData.txtcontains the following data:Randy Gill AThe 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 thatp The fifth line contains an uppercaseletter betweenAandYinclusive 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 width area parameter Circle:Radius area circumference Name: Randy Gill, age: Beginning balance $ interest rate Balance at the end of the month $The character that comes after A in the ASCII set is BeWrite the statement that closes the output file.fWrite 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started