In: Computer Science
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.
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)