Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A company assigns a letter to each of its organizational departments as shown in the figure. Write a Python program that uses a text prompt
A company assigns a letter to each of its organizational departments as shown in the figure. Write a Python program that uses a text
prompt to ask the user for one of the letters used. Check that the user has entered one of those allowed letters, but it can be uppercase
or lowercase; if not, print a sentence indicating that an "error" occurred and then end without printing anything else. For allowed letters, use
a cascaded if structure to convert that letter into a string, according to the table below. Store the string in a string variable. Then, after the
if structure, print out a sentence that indicates the name of the department.
Sample runs:
Enter the department code A H M O P R S or T: A
The code refers to the Accounting department.
Enter the department code A H M O P R S or T: E
Error: The code number must be A H M O P R S or T
C: Users brokow Classes Spring Assignmentspython
hwbpy
Enter the department code A H M O P R S or T:
The code refers to the Operations department.
C: Users brokow Classes Spring Assignmentspython
hwbpy
Enter the department code A H M O P R S or T: r
The code refers to the Research of Development department.
LAB
input values in the first box, then click Run program and observe the program's output in the
second box.
Enter program input optional
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