Answered step by step
Verified Expert Solution
Link Copied!

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 classCh3_PrExercise1{public static voidmain(String[]args){...}} 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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago