Question: Create the public class Module1 with the following data fields and methods: 1) Data fields: a. an object of type Scanner named sc (you

Create the public class Module1 with the following data fields and methods:

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

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 full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!