Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 - Objective The purpose of this assignment is for students to practice File IO in Java. 2 - The Program You must detect all
1 - Objective The purpose of this assignment is for students to practice File IO in Java. 2 - The Program You must detect all of the the email addresses in the input file called input.txt. If an email address does not have a sub-domain, create an Email object to store the contents of that email. If an email address does have a sub-domain, please create UniversityEmail object for that email. You must store all emails in the same (one single) array. 2.1 Email Class Define a base class called Email. The class Email will have 3 String member variables: username, domain,and extension. For example, if one of the email addresses in the file is wearelivinginasimulation21@ridiculousconspiracytheories.net, then the values of the member variables should be: Username: wearelivinginasimulation21 Domain: ridiculousconspiracytheories - -Extension: net The Email class should contain a function that returns the code value of 0 and will be overwritten in the extended class to return the various associated codes for each UniversityEmail. This will enable you to print your output by code selection. Refer to section 22 for information about the code value. 2.2 UniversityEmail Extended Class Derive a class called UniversityEmail that extends Email. UniversityEmail will have 2 additional member variables: department (string) and code (int). Refer to the table below to assign a value to the member variable code. 1 - Objective The purpose of this assignment is for students to practice File IO in Java. 2 - The Program You must detect all of the the email addresses in the input file called input.txt. If an email address does not have a sub-domain, create an Email object to store the contents of that email. If an email address does have a sub-domain, please create UniversityEmail object for that email. You must store all emails in the same (one single) array. 2.1 Email Class Define a base class called Email. The class Email will have 3 String member variables: username, domain,and extension. For example, if one of the email addresses in the file is wearelivinginasimulation21@ridiculousconspiracytheories.net, then the values of the member variables should be: Username: wearelivinginasimulation21 Domain: ridiculousconspiracytheories - -Extension: net The Email class should contain a function that returns the code value of 0 and will be overwritten in the extended class to return the various associated codes for each UniversityEmail. This will enable you to print your output by code selection. Refer to section 22 for information about the code value. 2.2 UniversityEmail Extended Class Derive a class called UniversityEmail that extends Email. UniversityEmail will have 2 additional member variables: department (string) and code (int). Refer to the table below to assign a value to the member variable code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started