Read an input file containing text and a single word

Assignment Help Computer Engineering
Reference no: EM132200522

Write a Java application that reads an input file containing text and a single word. The output of the program is a display of a list of lines that contain that word from the file followed by the total number of occurrences of the word in the file.

For example, if the input file was the following:

`Twas brillig, and the slithy toves

Did gyre and gimble in the wabe:

All mimsy were the borogoves,

And the mome raths outgrabe.

and the search word was and your program should print something like this:

`Twas brillig, and the slithy toves

Did gyre and gimble in the wabe:

And the mome raths outgrabe.

The word "and" appears 3 times in the input file.

The program is to prompt the user for the input file name and the search term, in that order.

Your program should be preceded by a comment block with your name, the course and section numbers, the project name, the program purpose, along with a description of the input and a description of the output.

Be sure to include appropriate comments throughout your code, choose meaningful identifiers, and use indentation as shown in your textbook and in class. Your Java source code file name should be Search.java.

Reference no: EM132200522

Questions Cloud

Prepare a method to multiply two n times n matrices : Write a Java method to multiply two N times N matrices (2D arrays). The two matrices are received as parameters.
Write a java method which takes a 2-darray of double : Write a Java method, findAverages, which takes a 2-dimensional array of double as a parameter and returns a 1-dimensional array of double containing.
Write a java gui application which can take a date : Write a Java GUI application, which can take a date (no earlier than 1900) from a user and show its corresponding day of the week.
Prompt the student to enter their user name and password : Prompt the student to enter their user name and password. Read a file that contains a list of all students' information to validate the login credentials.
Read an input file containing text and a single word : Write a Java application that reads an input file containing text and a single word.
Prompt the user for pairs of inputs of a product number : Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold.
Write a code program with a loop that lets the user enter : Write a java code program with a loop that lets the user enter a series of positive integers.
Calculate the time required for each of three trip : Prompts the user for destination, number of miles driven, and speed driven (both as integer values).
Demonstrate your work : The driver class should create Pizzas of various sizes and demonstrate that all the methods work correctly.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Vulnerabilities of routers and web servers

Explain the vulnerabilities of routers and the Web servers and remediation strategies which will make them more secure.

  Consider a rectangular array of cells

The game of Life, invented by the mathematician John H. Conway, is intended to model life in a society of organisms. Consider a rectangular array of cells, each of which may contain an organism.

  Propose a possible change in organization physical security

Propose a possible change in that organization's physical security that could have prevented the breach/failure for that scenario.

  Create constructor for the class named car

Write down the statements to create an overloaded constructor for the class named Car. The constructors should support 0, 1, or 2 arguments. The first argument will denote the engine size and contain an Integer.

  Make a web page named double.html

design a Web page named double.html whose HEAD includes the DoubleIt function. The page should contain a text box with an initial value of 1 and a button labeled "Double It". When user clicks the button, the DoubleIt function should be called to d..

  Complete the design wlan based on ieee 802.11

Explain why 802.11b, is the first widely popular standard and still by far most used by the IT industry today.

  How has the knowledge gained the past few weeks increased

How has the knowledge gained these past few weeks increased your chances of functioning as a computer security administrator?

  Illustrate the methods for data validation

Illustrate the methods for Data Validation and Illustrate the methods of Hardware Testing - What is the weakest-precondition of a program

  Explain the two characteristics of ajax

Explain the two characteristics of Ajax that help it achieve its goals. Why the callback function is written as an anonymous function in request phase function.

  How you would buy a domain name and register it

Investigate how you would buy a domain name (like "mycooldomainname.org") and register it so that other users could find it.

  How many parameters does each method have

How many parameters does each method have? Which of the preceding methods will have a return statement as part of its body?

  How fulfilling a project managers responsibilities

Explain why and how each skill is useful in fulfilling a project manager's responsibilities

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd