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:
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
-
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?
-
1. What should Jame conclude about the data pattern of Surtido cookie sales? 2. What did Jame learn about the forecast accuracy of Karin's suggestion? GAMESA Company is the largest producer of...
-
A gas obeying the equation of state p(V-nb) = nRT is subjected to a Joule- Thomson expansion. Will the temperature increase, decrease, or remain the same?
-
Captain Billy Whizbang Hamburgers, Inc., issued 6\%, 10-year bonds payable at 95 on December 31, 2005. At December 31, 2007, Captain Billy reported the bonds payable as follows: Captain Billy uses...
-
A copper calorimeter can with mass 0.100 kg contains 0.160 kg of water and 0.0180 kg of ice in thermal equilibrium at atmospheric pressure. H 0.750 kg of lead at a temperature of 255C is dropped into...
-
Amcor Limited, an Australian company, can issue three years Swiss franc-denominated bonds with a coupon rate of 3.02 per cent. Assuming that Amcor can issue bonds worth A$5.94 million that the...
-
you will complete Hands-On Project 11-1 Configure ACLs in Packet Tracer Follow the instructions for Steps 1-8 Take a screenshot at the end of Step 4 and paste into a word processing document Answer...
-
What is your vision of the future of sport management?
-
Explain why each of the four steps of delegating is necessary.
-
What is the first and most important question you ask to determine what and what not to delegate?
-
How does the systems effect relate to the four variables of change?
-
How do the management functions relate to change?
-
There are a number of theories of the term structure of interest rates including the unbiased expectations hypothesis, preferred habitat hypothesis, and market segmentation hypothesis. Discuss the...
-
Keating & Partners is a law firm specializing in labour relations and employee-related work. It employs 25 professionals (5 partners and 20 managers) who work directly with its clients. The average...
-
Let a be the number such that the area to the right of z = a is 0.21. Without using a table or technology, find the area between z = a and z = a.
-
Your medical terminology instructor listed the following grades for the class out of a 75-point test: 34, 36, 41 , 43, 44,49,50, 55,57, 60,64, 66, 67,67, 67,68,68,69, 70, 73 a. Find the 90th...
-
Use the following information to compute the ALOS and median LOS and range for Community Nursing Center. The discharge date is June 2, 20XX (a non-leap year). Round the ALOS to one decimal place....
Study smarter with the SolutionInn App