Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need it in Java pleaae cause it'll be helpful for my understanding Project 0 - File Reader Project Description Implement a simple file reader

i need it in Java pleaae cause it'll be helpful for my understanding image text in transcribed
image text in transcribed
Project 0 - File Reader Project Description Implement a simple file reader using your programming language of choice. The user is queried for the filename of an input file assumed to be in the same directory as the executable reader. The reader reads a file containing a sequence of characters and outputs each character to the screen, including whitespaces, along with its line and character positions in index-one-based numbering. After reading and displaying the input file has been completed, the user is queried for a new filename to read, infinitely, until the user responds with "quit" or "exit". Descriptive code comments and version control (i.e., Git) messages demonstrating progress within the completion of the project are required. You are not allowed to use any library or module that supports regular expressions, such as re of Python, and regex of Java and C++. Your program should include three procedures (each of which may be used in later projects): 1. nextChar(): reads the next character in the input file. (This will not return anything: it will cause the next character to be stored in memory.) 2. currentChar(): returns a string containing the character that was just read. 3. position(): returns a string containing the line and column integers separated by a colon character. The main program should have a loop for reading the input and printing the characters as follows: nextChar(); while ( currentChar() 1= "end-of-text") \{ print ( position() + "*+currentChar()); nextChar(); } Project 0 - File Reader Every character from the text file should be outputted to its own line on the screen in the following format: currentline() +:N+ currentColumn() ++ currentchar() For example, for an input file containing the following text: Hello cosc455! The reader should produce the following output: 1:1H1:2e1:311:411:502:02:1C2:202:352:4C2:52:642:752:852:91

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

Step: 3

blur-text-image

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Discuss the factors that set the stage for global HR practice.

Answered: 1 week ago

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago