Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python code please 3. Problem Statement: Simple.edu Email Address Class: In this assignment, we will be designing a simple .edu email address class. Email

In python code please

image text in transcribed

3. Problem Statement: Simple.edu Email Address Class: In this assignment, we will be designing a simple .edu email address class. Email address consists of three main parts: username, an at ('@') symbol and domain information. The purpose of this lab is to gain experience in python's basic class definition and object instantiation Class Definition: You need to write a simple class 'EmailAddress, where the class will have following instance variables and methods: 1. Instance variables: username, symbol and domain, all are string data type 2. _init_method: constructor method to initialize instance variables in #1. _str_method: Print representation of an object. The _str_ method should return the full email address. 4. is_address_valid(): This method returns True if following all conditions hold: a. 'edu' is present in the domain name and b. '@' symbol is present in the symbol and c. length of username must be greater than 1 and d. length of domain information is more than 4 The method returns False if one of the above conditions do not hold. Object Creation/Instantiation and method calling: 1. You need to create three objects 'al', 'a2' and 'a3' with following information: Object Username Symbol domain Comment john gmu.edu valid peter gmu.net invalid: no sign #empty string t.edu username is an empty string al a2 @ a3 @ invalid: 2. Print the information of all objects. Hint: _str_() method invoking. 3. Call is_address_valid method with all objects and check if they return True or False. Print appropriate informational message as shown in sample outcome below. Sample output: EmailAddress object created john@gmu.edu peter&gmu.net john@gmu.edu is valid.edu email address peter&gmu.net is invalid.edu email address @t.edu is invalid.edu email address

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Explain the causes of indiscipline.

Answered: 1 week ago

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago