Question
This assignment must bee completed in Python 3 Data Key: # Name: First middle last. Might have a middle name, might not. # Birthday: in
This assignment must bee completed in Python 3
Data Key:
# Name: First middle last. Might have a middle name, might not.
# Birthday: in form Day/Month/Year
# ID: starts with ss. Followed by four numbers.
# Sales:
# fX - number of refrigerators sold
# sX - number of stoves sold
# mX - number of microwaves sold
# Kilometers: Number of kilometers the salesperson drove. Xkm
###############################################################################
###############################################################################
# Instructions:
# - Your program will accept two commands: 'b' and 'p'. Each command
# will print infomation to the terminal in a tabular form. The program
# should provide a simple main menu and ask for a command.
# It should create and print the required information.
# It does not need a loop. It should run once and quit.
# It should ignore invalid commands.
# The data in the tuple has a specific format. Look at it closely
# before you start programming and take note of which symbols partition
# the data.
#
# - IMPORTANT: Your program must do all the work of slicing, combining and
# calculating the data, not you. This means, you
# cannot type out a new tuple, list, etc. with the correct information.
# This will result in an automatic zero.
#
# - 'b' stands for birthday. For this command your program will generate
# from the data below a list of employee birthdays without the year.
# The output should be in neat columns that are wide enough to print
# the longest name. The name printed should be the first name. Day and
# month should both be two digits (add zeros where necessary).
# Example:
# NAME MONTH DAY
# Sabrina 01 03
# Fergus 11 21
# etc...
#
# - 'p' stands for payday. This command calculates the monthly commission
# each salesperson gets based on their sales and kilometers driven.
# The formula is: commission =
# refrigerators * 50 +
# stoves * 75 +
# microwaves * 25 +
# kilometers * 0.5
# The data should be printed in the following form. Again it should be
# in neat columns.
# ID LAST F COMMISSION
# 9387 BRYAN S $599.50
# 5246 ARCHER F $326.00
# etc...
# Note: the ID is just the numeric part. The last name is in ALL CAPS.
# The commission amount has a $ and two decimal digits.
#
###############################################################################
data = (
('Sabrina Bryan,1/3/98,ss9387,f9;s1;m1,99km'),
('Fergus Connon Archer,11/21/89,ss5246,f1;s3,102km'),
('Adrian Harvey,3/3/78,ss1654,m5;s2,72km'),
('Patricia Abigail Wolf,9/5/00,ss0936,f3;s4;m8,134km'),
('Georgina Kramer,6/15/95,ss4837,f5;s2;m1,55km'),
('Glenn Julian Ayala,3/19/90,ss3689,s4;f3,152km'),
('Anita Davila,6/27/91,ss9367,f8,203km'),
('Gertrude Nunez,1/12/97,ss3948,s3;m1,34km'),
('Solomon Burton,8/5/88,ss7364,s2;f1,23km'),
('Rafael John Murray,10/19/01,ss9105,s9;f3,78km')
)
###############################################################################
# YOUR CODE GOES HERE
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