Answered step by step
Verified Expert Solution
Link Copied!

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 8 letters used. Check that the user has entered one of those allowed letters, but it can be upper-case
or lower-case; 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 ??UCM Classes ??ME021??2024 Spring Assignments>python
hw02b.py
Enter the department code (A, H, M, O, P, R, S, or T): 0
The code refers to the Operations department.
C: ??? Users ??? brokow ??UCM Classes ??ME021\2024 Spring Assignments>python
hw02b.py
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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

=+1. Have you used powerful language in your message?

Answered: 1 week ago