Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide comments with your code. This must be done in Java. Correct answer will be given a thumbs up asap. 2 - The Program

Please provide comments with your code. This must be done in Java. Correct answer will be given a thumbs up asap.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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 2.2 for information about the code value. 2.2 UniversityEmail Extended Class Derive a class called UniversityEmail that extends Email. University Email 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions