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

  Design logic for an application that allows a user to ordere

Design the logic for an application that allows a user to enter an ordered item continuously until a sentinel value is entered.

  Write a java application that prompts the user for pairs

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 (these are two separate prompts for input values).

  Discuss decentralization or federalism of the it function

Briefly describe one of the following two IT Management issues as discussed in class - centralization/ decentralization /federalism of the IT function

  Write a program that reads the contents of two text files

Write a program that reads the contents of two text files and compares them in the following ways.

  Design the disk and presents its code to the client

create a script that reads itself from the disk and presents its code to the client. A script where the user needs to enter the name of the file whose contents are to be displayed.

  Create an instance of a car and an airplane class

Assign values to the name, speed, number_of_cylinders (for the Car object) and number_of_engines (for the Airplane object) variables.

  What are the object-oriented and structured designs

explain the architectural differences between the object-oriented and structured designs.

  How does a table adapter differ from a data adapter

What happens when you drag a dataset table from the Data Sources window onto a blank form? How does a table adapter differ from a data adapter?

  Does it planning help managers exercise control

In what ways does IT planning help managers exercise control in a situation? Does IT impact the truck driver of a company who delivers supplies to its customer?

  Design program using switch statements in visual basic

design program using switch statements in Visual Basic.

  Explain the difference between hardware and software

Explain the difference between hardware and software. Describe what hardware is, as well as examples. Describe what software is, as well as examples.

  Draw a swimlane diagram for the given activity

Identify the classes and their attributes from the given paragraph and Draw a Class diagram for the given database. The diagram must show all classes

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