Using Java: read data from a file. write data to a file . and process string data

User Generated

kEnirakPbngk

Programming

Description

I have provide pics of the assignment.

I have also provide a zip file that contains code to read files and write file. You can use this or if it is easier come up with your own to answer the questions. All i really need is the last part "Step 4"

Unformatted Attachment Preview

ITSC 1213-003 Lab 5 Your next lab will be a lab test. The lab test counts as 25% of the entire Test 1. You are permitted to bring prepared notes, including printed code to the lab test, however this material must be printed before your lab session. Books and the use of the Internet will not be permitted. The test will consist of you writing a fully- documented and running Java project that can contain any material from any of your previous labs, including this lab. Purpose: To read data from a file. To write data to a file. To process string data character by character. Part 1: Download the code for this lab from Canvas. Read the source code and its documentation. Run each of the two main methods. 1 Part 2: Step 1: Open Notepad on your computer. Type in five lines of text. Save the file. Write down the exact location and name of the file. Do not forget the “.txt" when you write the name down. Notepad automatically saves your file with the .txt extension. Step 2: Create a Java project that has only one class, the driver. In main() write the code to read the data from Step 1 and print each line of text to the screen. Step 3: Create a new Java project. This project has only one class, the driver with main(). In main() write the code to create a file for output. Enter seven lines of text to write to the output file. Once the code is written to save all the lines to the file, write the code to print a message to the screen stating that the output file was created. Run main(), then check your computer to verify the data file was created and the contents are correct. Open the text file using Notepad to verify your data was saved as a text file. [continue with Step 4 on the reverse page] Step 4: Create a new Java project. This project has only one class, the driver with main(). In main() open a file for input. Use the text file you created in Step 3 above. The main() method needs to accomplish the following tasks. You can declare and use variables in main() and read one physical line of data at a time. Read all the steps a-e below before writing any code. a) Count and print how many times the letter ‘e' or 'E' appear in the file. b) Count and print how many vowels are in the data file. c) Count and print how many characters (including 'blanks’, but not newlines) are in the file. d) Count and print the number of times a non-space character is preceded by a space character. e) Print the contents of the file on the screen in all uppercase.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

I wrote the program required in step 4. I...


Anonymous
Great! Studypool always delivers quality work.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags