Complete java method called getword

Assignment Help JAVA Programming
Reference no: EM131914818

1. a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the first character of the parameter is a letter. If it is not a letter, the method throws an Exception of type Exception with the message of: "This is not a word."
2. a complete Java method called getWord that takes no parameters and returns a String. The method prompts the user for a word, and then calls the checkWord method you wrote in #1 above, passing as a parameter the word the user provided as input. Make sure the getWord method handles the Exception that may be thrown by checkWord.
3. a complete Java method called writeFile that takes two parameters: an array of Strings (arrayToWrite) and a String (filename). The method writes the Strings in the arrayTo array to a text file called filename (the parameter), with each String on a separate line.
4. complete Java method called readFile that takes a String as a parameter (filename) and returns an ArrayList of Strings (fileContents). The method reads the text file identified by the filename parameter and populates the ArrayList with an element for each line in the text file.
5. In your main method, do the following in the order specified:Call the getWord method you wrote in #2 above and print the result to the command line.
6. an array of Strings called testData and populate it with at least three elements.
7. l the writeFile method you wrote in #3 above passing the array you created in #5.2 and the String "data.txt".
8. the readFile method you wrote in #4 above to read the file you wrote in #5.3. Assign the result of readFile to an ArrayList variable in main called fileContents.
9. a loop to print the contents of the fileContents ArrayList to the command line.

Reference no: EM131914818

Questions Cloud

Explain your thoughts on observing people eat in public : Observe two people of the same gender and one of the other. I want you to observe the following and also what it is that they add to their meal.
How might the castle doctrine be supported morally : Under the castle doctrine, recognized in more than 20 states, generally homeowners may use force- including deadly force-to defend themselves in their own home.
What are the possible consequences : What is the ethical issue? What are your options? What are the possible consequences? What should you do?
Categorial imperative perspectives : The ride-share gig economy is ethical or not. Use one of the ethical lenses (utilitarianism, virtue or categorial imperative perspectives) on uber/lyft for defe
Complete java method called getword : complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception
Was alitalia or marriott obligated to honor the low prices : The Italian national airline, Alitalia, was charging more than $5,000 for trans-Atlantic, round-trip, business class airfares in 2006, but by mistake.
How would the accounting for the awards change : How would the accounting for the awards change if the modification to the terms of the award was made on January 1, 2014, after awards have become fully vested?
Discuss the role of the agency : Identify a specific governmental agency referenced in the textbook. Then do the following:
Sole proprietorship versus a partnership : What are the pros and cons of a sole proprietorship versus a partnership? What are the pros and cons of the corporation?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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