Create class named counter that has one string field

Assignment Help Computer Engineering
Reference no: EM13324001

In Eclipse, create a class named Counter that has one String field called text. It has a constructor that sets the one field from a parameter. It also has the following no-parameter methods: getCharCount that returns the number of characters in the text field, excluding '\n' (new line) and '\t' (tab) characters; getWordCount that returns the number of words in the text field, which are sequences of characters separated by new line, tab, space(s), period or comma; and getLineCount that returns the number of lines.

Also create a Main class that has the normal main method that you need to start the program. The main method should ask the user for the name of a local input file, and return an error message if it cannot find the file. The input file should be long and varied enough that you can test the Counter methods. Having found the file, your program should create a Counter object with a String parameter that has the contents of the input file. Then you print out the test string along with the various counts, including appropriate labeling of the numbers.

 

Reference no: EM13324001

Questions Cloud

Explain what is the strongest attractive force : What is the strongest attractive force that must be overcome in order to do the following: a) melt pure solid phosphorus pentachloride b) boil pure liquid selenium tetrafluoride
Compute his marginal cost and average cost of cutting lawns : Edward the entrepreneur takes two hours to cut a lawn, and he cuts 1,000 lawns per year, he use solar powered equipment thw will last forever and can be sold for $20000. the interest rate is 10 perent given his current output level, compute his margi..
How the listed variables impact the prices : Mr. Curtis explaining how the listed variables impact the prices of call options and what the associated theory is behind each relationship:
Determine the mass distribution of lead in the marsh : If metal sorption to algae can be modeled by a Langmuir isotherm, determine the mass distribution (sorbed vs dissolved) of lead in the marsh. Langmuir Isotherm Parameters Cs , sat 100 mg/g a 0.1 L/mg
Create class named counter that has one string field : create a Main class that has the normal main method that you need to start the program. The main method should ask the user for the name of a local input file.
Determine the volume of the paint : A partly-full paint can has 0.82 U.S. gallons of paint left in it. What is the volume of the paint
Explain how to boil pure liquid methanol : What is the strongest attractive force that must be overcome in order to do the following: a) melt pure solid phosphorus pentachloride b) boil pure liquid selenium tetrafluoride c) boil pure liquid methanol (CH3OH) d) sublime pure solid carbon dio..
What are the firms earnings per share : If the Marifield Steel Fabrication Company earned $500,000 in net income and paid a cash dividend of $300,000 to its stockholders and what are the firm's earnings per share if the firm has 100,000 shares of stock outstanding?
Create a gui system that will allow a user to add and remove : Create a GUI system that will allow a user to add and remove employees where each employee has an employee id (six-digit number), employee name, and years of service.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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