University of North Texas Python Programming Project
Description
Write a program that gets a string containing a person’s first, middle, and last names, and displays their first, middle, and last initials. For example, if the user enters Susan Smith Miller, the program should display S.S.M.
Define main():
Declare Local variables
Prompt user to enter the full name
Use split method to split the full name
User for loop to get first character of each name as an initial
Display output
Sample output:
Enter your full name: Susan Smith Miller
S.S.M.
Q2: Employee class :
Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department and job title.
Once you have written a class, write a program that creates three Employee objects to hold the following data:
Name |
ID Number |
Department |
Job Title |
Susan Meyers |
47899 |
Accounting |
Vice President |
Mark Jones |
39119 |
IT |
Programmer |
Joy Rogers |
81774 |
Manufacturing |
Engineer |
The program should store this data in the three objects, then display the data for each employee on the screen.
Example OUTPUT:
Employee 1:
Name: Susan Meyers
ID number: 47899
Department: Accounting
Title: Vice President
Employee 2:
Name: Mark Jones
ID number: 39119
Department: IT
Title: Programmer
Employee 3:
Name: Joy Rogers
ID number: 81774
Department: Manufacturing
Title: Engineer
Q3: Customer class :
Write a class named Person with data attributes for a person’s name, address, and telephone number. Next, write another class named Customer that is a subclass of the Person class. The Customer class should have a data attribute for a customer number, and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Demonstrate an instance of the Customer class in a simple program.
Sample output:
Enter the name: john
Enter the address: 239 lovers lane
Enter the phone_number: 817-907-5367
Enter the customer number: 0011
Does the customer wish to be on the mailing list?(Yes/No) Yes
Customer information:
Name: john
Address: 239 lovers lane
Phone number: 817-907-5367
Customer Number: 0011
On Mailing List: True
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."