The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 364 Weeks Ago, 1 Day Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
Write a class called FileOperations that accepts a string value in a variable called str which represents the name of a text file residing on an external storage device. Provide the following:
a)     A constructor that accepts the string str, representing the file name, and creates a LineNumberReader object.                                                                                   [ 1 mark]
(b)    A mutator method that reads the file line by line until the file is empty.                 [ 2 marks]
(c)     An accessor method that determines if the actual file exists.                                 [ 1 mark]
(d)    An accessor method that returns the number of bytes in the file.                         [ 1mark]
(e)     An accessor method that returns the name of the file.                                         [ 1 mark]
(f)      The declaration of appropriate variables and use of Exception where necessary.   [ 2 marks]
Â
Note :– a test class is NOT required
Â
Â
Â
Â
Exceptions identify errors that arise in your program. Name the two categories of exceptions that are derived directly from Throwable and differentiate between them.
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I