Question

In: Computer Science

Solve with Python: The following is the color code of the jackets of employees for a...

Solve with Python:

The following is the color code of the jackets of employees for a companies annual conference. The Color is determined by the Employee category and the state in which they work.

Employee Category

Executive (1)

Director(2)

Manager(3)

Worker(4)

State

Jacket Color

State

Jacket Color

State

Jacket Color

State

Jacket Color

NY, NJ, PA

Blue

NY, NJ, PA

Purple

NY, NJ, PA

Red

NY, NJ, PA

Black

TX, LA, FL

White

TX, LA, FL

Green

TX, LA, FL

Maroon

TX, LA, FL

Grey

Get the employee category (1/2/3/4) and the state from the user and display what color code he/she has to follow for the conference.

Solutions

Expert Solution

employeeCategory=int(input('Enter employee category(1/2/3/4): '))
state=input('Enter state(NY/NZ/PA/TX/LA/FL): ')
state1=['NY','NJ','PA']

color=''
if employeeCategory==1:
    if state.upper() in state1:
        color='Blue'
    else:
        color='White'
elif employeeCategory==2:
    if state.upper() in state1:
        color='Purple'
    else:
        color='Green'
elif employeeCategory==3:
    if state.upper() in state1:
        color='Red'
    else:
        color='Maroon'
else:
    if state.upper() in state1:
        color='Black'
    else:
        color='Grey'

print('Color code to follow:',color)


Related Solutions

I just wrote Python code to solve this problem: Write a generator that will return a...
I just wrote Python code to solve this problem: Write a generator that will return a sequence of month names. Thus gen = next_month('October') creates a generator that generates the strings 'November', 'December', 'January' and so on. If the caller supplies an illegal month name, your function should raise a ValueError exception with text explaining the problem. Here is my code: month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] def next_month(name: str) -> str:...
User Python to solve; show all code: A user will enter in data for a basketball...
User Python to solve; show all code: A user will enter in data for a basketball team. For each player on the team the user will enter The player’s last name The average number of point the player scored last season The number of games the player is projected to play in this year Write a program that will prompt the user for the player data described above. The user does not know how many players are on the team...
Please solve everything using Python 3 1. What does list contain after the following code is...
Please solve everything using Python 3 1. What does list contain after the following code is executed? list = [82, 27, 66, 18, 40, 93, 85, 29] list.append(50) list.insert(3, 99) list.pop() a. [82, 27, 66, 99, 18, 40, 93, 85, 29] b. [50, 82, 27, 99, 66, 18, 40, 93, 85] c. [27, 66, 99, 18, 40, 93, 85, 29, 50] d. [82, 27, 99, 66, 18, 40, 93, 85, 29] 2. What does list contain after the following code...
Roberts, an outfit manufacturer, produces a line of jackets. There are currently 3 temporary employees and...
Roberts, an outfit manufacturer, produces a line of jackets. There are currently 3 temporary employees and 12 full-time employees to produce parkas. More temporary employees can be hired if additional production capacity is needed. Each full time employee can produce 205 jackets, whereas each temporary employee can produce 165 jackets per month. Demand for jackets for the next four months is as follows: October 3,200 November 2,800 December 3,100 January 3,000 i. The beginning inventory in October is 403 jackets....
Use Python to solve, show all code Write a program that sums a sequence of integers...
Use Python to solve, show all code Write a program that sums a sequence of integers from a starting integer to and ending integer. The sequence is generated by skipping a value (e.g. 1,3,5,… or 2,6,10,14…). Prompt the user for a) a starting value greater than 0. Validate the value is greater than 0. b) the ending value. c) the value to skip Print out the sum of the numbers for the sequence. If the starting value is 2, the...
Write a python script to solve the 4-queens problem using. The code should allow for random...
Write a python script to solve the 4-queens problem using. The code should allow for random starting, and for placed starting. "The 4-Queens Problem[1] consists in placing four queens on a 4 x 4 chessboard so that no two queens can capture each other. That is, no two queens are allowed to be placed on the same row, the same column or the same diagonal." Display the iterations until the final solution Hill Climbing (your choice of variant)
Use Python to solve each problem. Answers should be written in full sentences. Define a code...
Use Python to solve each problem. Answers should be written in full sentences. Define a code that will give users the option to do one of the following. Convert an angle from radians to degrees, Convert an angle from degrees to radians, Return the sine, cosine, or tangent of a given angle (need to know if angle is given in degrees or radians).
Use Python to solve: show all code: 2) For the last assignment you had to write...
Use Python to solve: show all code: 2) For the last assignment you had to write a program that calculated and displayed the end of year balances in a savings account if $1,000 is put in the account at 6% interest for five years. The program output looked like this: Balance after year 1 is $ 1060.0 Balance after year 2 is $ 1123.6 Balance after year 3 is $ 1191.02 Balance after year 4 is $ 1262.48 Balance after...
Use a python code to solve Use Newton interpolation to find the unique polynomial p2(x) of...
Use a python code to solve Use Newton interpolation to find the unique polynomial p2(x) of degree 2 or less, that agrees with the following data: p2(0) = 1, p2(2) = 5, p2(4) = 17.
Write and Compile a python script to solve the 4-queens problem using. The code should allow...
Write and Compile a python script to solve the 4-queens problem using. The code should allow for random starting, and for placed starting using numpy "The 4-Queens Problem[1] consists in placing four queens on a 4 x 4 chessboard so that no two queens can capture each other. That is, no two queens are allowed to be placed on the same row, the same column or the same diagonal." Display the iterations until the final solution Arc consistency
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT