Problem

Opening Files and Performing File Input In this lab, you will open a file, flowers.dat...

Opening Files and Performing File Input

In this lab, you will open a file, flowers.dat, and read input from that file in a prewritten Java program. The program should read and print the names of flowers and whether they are grown in shade or sun.

1. Open the source code file named Flowers.java using Notepad or the text editor of your choice.

2. Declare the variables you will need.

3. Write the Java statements that will open the input file, flowers.dat, for reading.

4. Write a while loop to read the input until EOF is reached.

5.In the body of the loop, print the name of each flower and where it can be grown (sun or shade).

6. Save this source code file in a directory of your choice, and then make that directory your working directory.

7. Compile the source code file Flowers java.

8. Execute the program.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 7
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT