Question: Writr python code for these. Triangle Enter shape code ( 1 = square, 2 = triangle, 3 = arrow head ) : 2 Enter shape
Writr python code for these.
Triangle
Enter shape code square, triangle, arrow head:
Enter shape size:
Arrow Head Note: Not all sizes for the arrowhead will result in a symmetrical shape. That's OK
Enter shape code square, triangle, arrow head:
Enter shape size: You are the manager for a large, national company and you oversee a team of salespeople.
Each sales person is responsible for one Canadian city. At the end of the year, you would like to
determine a the average sales for the entire company and b which sales person achieved the
highest sales, so that you can offer them a bonus.
You have a decent grasp of Python and you also have access to the sales data so you proceed to
design and code a program to generate your results.
The data is stored in a list like this:
salesData Dave,
etc, etc
Program Requirements:
Add at least cities worth of data to the salesData list by adding city names strings
sales people names strings and sales amounts floats You can use the sample
salesData as a starting point.
Include a function that accepts the salesData list as a parameter and returns the overall
average company sales.
Include a function that accepts the salesData list as a parameter and returns the name
of the sales person who generated the highest sales.
Do no printing in the functions.
No data must be collected from the user.
Print out the average company sales for the year and a congratulatory message for the
employee with the highest sales in the main body of the program.
Sample Program Output
The average sales for all locations is: $
Congratulations, Andrea. You are eligible for a bonus! Within Canada, phone numbers have this format:
AAA CCCSSSS
Where:
AAA digit area code
CCC digit central office code
sSSS digit station code
Example:
Create a program that will prompt the user for a phone number, validate that the number is in an
acceptable format and check if the area code matches an actual city.Program Requirements:
In the main body of the program, prompt the user for a phone number. This will be a string.
Pass this string as a parameter to a function called checkFormat that will verify all the properties
of the phone number:
Brackets, space and hyphen in the correct positions. The string is characters long.
The Area code is a valid digit integer
The Central Office code is a valid digit integer
The Station code is a valid digit integer
checkFormat needs to return a True or False.
If the number is in the correct format, the main body of the program will print "Format OK
Pass the phone number to a function called verifyAreaCode that will check if the area code
entered corresponds to an actual city. Use this list of citiesarea codes in your function:
cityList HamiltonOttawaMontreal
Halifax
verifyAreaCode needs to return a True or False. If the area code is associated with one of the
cities in cityList, the main body of the program will print "Valid Area Code", otherwise "Invalid
Area Code".
Sample Program OutputFormat OK
Valid area code
Enter a phone number: abcde
Format error!
Enter a phone number:
Format OK
Invalid area code!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
