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.
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.