Write a Java program that will input a file name to be opened for reading. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that will input a file name to be opened for reading. The java file must only read the first sentence of the file and print on the output. Each line of code should be explained with comments. The requirements of your Java program is listed below (Total: 30 marks) a) Ensure all the necessary packages and classes needed for the program development are made available, with a class to define the data members and functions that the object of this scenario should have. [2 marks for the comment] (5 marks) b) This class should also host the following methods o A function to write a new filename from the keyboard. Note the file name should be inputted from the user. [2 marks for the comment] (5 marks) o A function to write to a stored text file on your system, write text to be inputted by the user. [3 marks for the comment] (6 marks) c) Exception handling mechanisms should be included in your program wherever they are needed to ensure the smooth running of your program. o The exception handler should be suitable for the possible exceptions that may occur. o 4 marks for the comment. (8 marks) d) A class hosting the main method and creation of object to test the functionalities. o Ensure that all variables are used and functions are tested. Write a Java program that will input a file name to be opened for reading. The java file must only read the first sentence of the file and print on the output. Each line of code should be explained with comments. The requirements of your Java program is listed below (Total: 30 marks) a) Ensure all the necessary packages and classes needed for the program development are made available, with a class to define the data members and functions that the object of this scenario should have. [2 marks for the comment] (5 marks) b) This class should also host the following methods o A function to write a new filename from the keyboard. Note the file name should be inputted from the user. [2 marks for the comment] (5 marks) o A function to write to a stored text file on your system, write text to be inputted by the user. [3 marks for the comment] (6 marks) c) Exception handling mechanisms should be included in your program wherever they are needed to ensure the smooth running of your program. o The exception handler should be suitable for the possible exceptions that may occur. o 4 marks for the comment. (8 marks) d) A class hosting the main method and creation of object to test the functionalities. o Ensure that all variables are used and functions are tested.
Expert Answer:
Answer rating: 100% (QA)
java import javaioBufferedReader import javaioBufferedWriter import javaioFileReader import javaioFileWriter import javaioIOException import javaioInp... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
I need a new/different perspective on this initial discussion post. Thanks. Tommy Teenager (TT) is an enthusiastic, new employee at a local grocery store, Food Fetch (FF). His boss is Mary Manager...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
You must decide whether to buy, build or lease a building for your business needs over the next 10 years. If you decide to build, you must determine if it is better to buy an existing building and...
-
Make a comparison of the following insurance coverage premium bids and determine from a costing standpoint, which offer is better. Show your calculations: Assume that you, as a risk manager would...
-
The density of gasoline varies with pressure approximately as follows: p, atm: 1 500 1000 1500 , lbm/ft3: 42.45 44.85 46.60 47.98 Estimate (a) Its speed of sound, and (b) Its bulk modulus at 1 atm.
-
You have been given the following information about the production of Usher Co., and are asked to provide the plant manager with information for a meeting with the vice president of operations....
-
A very small needle valve is used to control the flow of air in a \(\frac{1}{8}\)-in. air line. The valve has a pressure drop of \(4.0 \mathrm{psi}\) at a flow rate of \(0.005 \mathrm{ft}^{3} /...
-
In a completely randomized design, 12 experimental units were used for the first treatment, 15 for the second treatment, and 20 for the third treatment. Complete the following analysis of variance....
-
The following information relates to Larkspur Ltd.'s inventory transactions during the month of August. Units Cost/Unit Amount August 1 Beginning inventory 15 $1,900 $28,500 6 Purchase 35 $1,520...
-
Craig Fisher started a lawn service called Craigs Quick Cut to earn money over the summer months. Fisher has decided to use the following accounts for recording transactions: Assets Revenue Cash Lawn...
-
David Perkins left a successful career in the NFL after two head injuries. For his safety, his doctors recommended he leave the sport if he wanted to live past the age of 30. David, not one who sits...
-
Identify the tax issue(s) posed by the facts presented.problem Determine the possible tax consequences of each issue that you identify.problem a.problem Harvey sells his personal residence on March...
-
please clear and fast with comments that explains what happens in that line School Billing System Objective: Create a School Billing System project in C programming language that would typically have...
-
1. You have two assets, A and B, whose one -period returns have joint covariance matrix = [ a ab ab of ] Derive the optimal minimum-variance portfolio weights for the two assets, as a function of 22,...
-
Identify a well-known group that community members might join, such as a sporting team. a. Describe the key activity in which the group participates. b. What is the purpose of the group? What needs...
-
The new CEO has a plan to reduce fixed costs by $250,000 and variable costs by $0.50 per unit. Using the same markup percentage as in requirement 1, calculate the new selling price. Begin by...
-
Cyber Marketing and eCommerce Search for a business or e-commerce that is currently operating. In this forum, explain to your classmates what products and services you offer, who the business is...
-
Pedro Bourbone is the founder and owner of a highly successful small business and, over the past several years, has accumulated a significant amount of personal wealth. His portfolio of stocks and...
-
For each of the following cases, indicate the filing status for the taxpayer(s) for 2012 using the following legend: A - Single B - Married, filing a joint return C - Married, filing separate returns...
-
Olive Corporation was formed and began operations on January 1, 2012. The corporation's income statement for the year and the balance sheet at year-end are presented below. The corporation made...
-
Mike purchases a heavy-duty truck (5-year class recovery property) for his delivery service on April 30, 2012. The truck is not considered a passenger automobile for purposes of the listed property...
-
Selected transactions from the journal of Wong Consultants are presented below (amounts in thousands). Instructions a. Post the transactions to T-accounts. b. Prepare a trial balance at August 31,...
-
The order of the accounts in the ledger is: a. assets, revenues, expenses, liabilities, share capitalordinary, dividends. b. assets, liabilities, share capitalordinary, dividends, revenues, expenses....
-
The T-accounts below summarize the ledger of Negrete Landscaping at the end of the first month of operations (amounts in ). Instructions a. Prepare the complete general journal (including...
Study smarter with the SolutionInn App