Create the public class Module1 with the following data fields and methods: 1) Data fields: a....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create the public class Module1 with the following data fields and methods: 1) Data fields: a. an object of type Scanner named sc (you can import the Scanner class from java.util. Scanner) b. three String named input, file, and extension 2) Methods: a. a constructor method that: creates the Module1 object's Scanner object (sc) by calling Scanner's constructor method with the System.in argument to read console input b. A main method (ie., with the header public static void main(String[] args)) that, in order: Creates a new Module1 object named m by calling Module1's constructor method . Prints the message "beginning application to the console Prints a message to the console (use System.out.printin0) asking the user to enter a filename with the format "[filename]. [extension]" Reads the user input using the Scanner object's nextLine() method and assigns the String it returns to the Module1 object's input field Prints a message confirming the user's input: Displays the substring before the period with the label "filename: " Displays the substring after the period with the label "extension: " Prints the message "ending application" to the console Additional Constraints Other than Module1's main method, all data fields & methods should be for individual objects, not the entire class. Comments should be provided at the start of the file (i.e., above the class definition) giving the class author's name and the date the program was finished. Create the public class Module1 with the following data fields and methods: 1) Data fields: a. an object of type Scanner named sc (you can import the Scanner class from java.util. Scanner) b. three String named input, file, and extension 2) Methods: a. a constructor method that: creates the Module1 object's Scanner object (sc) by calling Scanner's constructor method with the System.in argument to read console input b. A main method (ie., with the header public static void main(String[] args)) that, in order: Creates a new Module1 object named m by calling Module1's constructor method . Prints the message "beginning application to the console Prints a message to the console (use System.out.printin0) asking the user to enter a filename with the format "[filename]. [extension]" Reads the user input using the Scanner object's nextLine() method and assigns the String it returns to the Module1 object's input field Prints a message confirming the user's input: Displays the substring before the period with the label "filename: " Displays the substring after the period with the label "extension: " Prints the message "ending application" to the console Additional Constraints Other than Module1's main method, all data fields & methods should be for individual objects, not the entire class. Comments should be provided at the start of the file (i.e., above the class definition) giving the class author's name and the date the program was finished.
Expert Answer:
Answer rating: 100% (QA)
Heres the Java code for the Module1 class with explanations Java Author Your Name replace with your name Date 20230520 replace with the date you compl... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these programming questions
-
A zero - coupon bond's market price is quoted at 8 6 . 9 5 . Its face value is $ 1 , 0 0 0 and it matures in 4 years. What is the 4 - year spot rate?
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
4 Comparative Programming Languages illustrating your answer by explaining the meaning of the following fragment of code: [self isAwake] whileTrue: [| item | item := self askForCookie. (self...
-
Apply the Western Electric rules to the control chart presented in Exercise 5.16. Would these rules result in any out-of-control signals?
-
This question refers to Problem 9. Use exponential smoothing with a smoothing constant of .2 and an initial value of 9.29 to forecast the yield for January 2007. Is this forecast better than the...
-
The following four structures are naturally occurring optically active compounds. Star the asymmetric carbon atoms in these structures. CHO H CH, COOH OH OH H,N H serine erythrose menthol camphor
-
Consider an economy with two types of risk-neutral borrowers. Borrowers are protected by limited liability. There are one-period projects that require \($100\) to be carried out. The bank is...
-
The Diversified Portfolio Corporation provides investment advice to customers. A condensed income statement for the year ended December 31, 2018, appears below: Service...
-
11 The GMAT (continued). Exercise 17.1 describes a study of the performance on the GMAT of college seniors in the Philippines. You stated the null and alternative hypotheses in Exercise 17.3. = 542....
-
The initial capital outlay is $75,000, the annual operating cash flows are $9,375, the project will run for 26 years, the after-tax-salvage cash flow is guessed to be $150,000, the required rate of...
-
Putting yum on peoples faces around the world is the mission of YUM Brands, Inc. Yum was spun off from PepsiCo in 1997. A spin-off occurs when a company separates its operations into two or more...
-
Which of the following cost(s) is (are) recorded directly into the Work in Process Inventory account? a. Direct materials. b. Indirect materials. c. Direct labor. d. Both a and c. e. All of the above.
-
Explain the difference between a direct cost and an indirect cost. Look at the pen or pencil you are using to do your homework. Give an example of a direct cost that went into making that pen or...
-
How are the four basic management functions interrelated?
-
Which of the following source documents serves as a sub sidiary ledger for the Work in Process Inventory account? a. Production order form. b. Materials requisition form. c. Direct labor time ticket....
-
To ensure that you understand the accounting equation (A = L + E), and how particular transactions affect it, complete the following exercise. You are simply required to explain how each event listed...
-
1. Use these cost, revenue, and probability estimates along with the decision tree to identify the best decision strategy for Trendy's Pies. 2. Suppose that Trendy is concerned about her probability...
-
How can a profitable business fail? a Because it can't pay its bills b Because it has more current liabilities than current assets c Because it has a bank overdraft d Because it has too much cash
-
When adjusting an operating profit to calculate the 'cash flows from operating activities', an increase in inventories over the financial period would be: a Added to operating profit b Ignored c...
-
Cash has been described as: a The lifebuoy of the business b The lifeboat of the business c The lifeline of the business d The lifeblood of the business
Study smarter with the SolutionInn App