Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Financial Accounting Expert

Basic Java** Each method below including main should handle (catch) any Exceptions that are thrown **

** If an Exception is thrown and caught, print the Exception's message to the command line **

1. Write 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 "This is not a word."

2. Write 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. Write 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 arrayToWrite array to a text file called filename (the parameter),  with each String on a separate line. 

4. Write a 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. Do the following in the main method (hint: the order is important):
5.1 Call the getWord method you wrote in #2 above and print the result to the command line.
5.2 Create an array of Strings called testData and populate it with at least three elements.
5.3 Call the writeFile method you wrote in #3 passing the array you created in #5.2 and the String "data.txt". 
5.4 Call the readFile method you in #4 to read the file you wrote in 5.3. 
Assign the result of readFile to an ArrayList variable in main called fileContents.
5.5 Write a loop to print the contents of the fileContents ArrayList to the command line.

Financial Accounting, Accounting

  • Category:- Financial Accounting
  • Reference No.:- M91575052
  • Price:- $20

Guranteed 24 Hours Delivery, In Price:- $20

Have any Question?


Related Questions in Financial Accounting

What has been strides position on dividend payouts in the

What has been Strides' position on dividend payouts in the past (pattern, relationship with earnings, etc.)? What factors affected its dividend policy?

Assessment -part a -saturn petcare australia and new

Assessment - Part A - Saturn Petcare Australia and New Zealand is Australia's largest manufacturer of pet care products. Saturn have been part of the Australian and New Zealand pet care landscape since opening their firs ...

Lease classification considering firm guidance issues

Lease Classification, Considering Firm Guidance (Issues Memo) Facts: Tech Startup Inc. ("Lessee") is entering into a contract with Developer Inc. ("Landlord") to rent Landlord's newly constructed office building located ...

Part adbm financial solutionsyou are a financial consultant

Part A DBM Financial Solutions You are a financial consultant working with DBM Financial Solutions and have a portfolio of clients you work with in achieving financial management solutions. Client 1- Manhattan Limited Yo ...

Consider the following account starting balances and

Consider the following account starting balances and transactions involving these accounts. Use T-accounts to record the starting balances and the offsetting entries for the transactions. The starting balance of Cash is ...

Ww productswith new productssales revenue

Without New Products With New Products Sales revenue $11,686,200 $16,263,600 Net income $486,300 $878,400 Average total assets $5,917,600 $13,539,700 (a) Compute the company's return on assets, profit margin, and asset t ...

Case study - the athletes storerequiredonce you have read

Case Study - The Athletes Store Required: Once you have read through the assignment complete the following tasks in order and produce the following reports Part 1 i. Enter the business information including name, address ...

Highway express has paid annual dividends of 132 133 138

Highway Express has paid annual dividends of $1.32, $1.33, $1.38, $1.40, and $1.42 over the past five years, respectively. What is the average divided growth rate?

Can you please help me with thishow do restrictions affect

Can you please help me with this. How do restrictions affect net assets in Not- For -Profit organization or health care?

Assignment - problem questionsthis assessment task consists

Assignment - Problem questions This assessment task consists of five (5) questions. All workings, when appropriate, must be shown to substantiate your answers. Question 1 - Financial statement disclosures You are the fin ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As