Question
Problem Statement: Organizations and their CEOs In this assignment, you will write a python application to identify the CEO and the organization they work for.
Problem Statement: Organizations and their CEOs
In this assignment, you will write a python application to identify the CEO and the
organization they work for. The purpose of this assignment is to gain experience in program
planning using pseudocode. You are given the pseudocode for the program and you will
translate the code into a python application.
Lab Scenario:
1. You are given a list containing the name of the organization and the name of the
organizations CEO.
2. The program will ask the user for a particular organization name or the name of a CEO, or
to press enter to receive a hint.
3. If the user requests a hint, a message is displayed providing only the names of 7
organizations, and the program prompts the user again to enter the CEO name this time.
4. It will run through the list to search for the organization name/CEO name provided by the
user.
5. The list is defined as follows:
a. Each item on the list is a string.
b. CEO name and organization name are separated by a colon (:).
c. You need to separate the CEO and the name of the organization by (:).
Hint: Remember how you split a string?
6. If the organization is found it will display the name of the CEO for that organization.
7. Similarly, the user could have entered the name of a CEO, and if the name is found,
the CEOs organization is displayed.
8. If the user input is not among the CEO/organization, the program should display the error
message as: " Wrong input, the program ends here .
9. For this lab, you are expected to use for loop to iterate through each item in the list. The
program needs to be case-sensitive. For example, the user can enter the name in all
lowercase but the program will still find the name of the CEO if present in the list. Hint:
string.lower() and string.upper() are two methods that can be used.
10. Seven CEOs in the list, shown below are also provided in your template file.
tech_companies = ["Apple:Tim Cook", "Amazon:Jeff Bezos", "Google:Sundar
Pichai",Microsoft:Satya Nadella", "Facebook:Mark Zuckerberg",
"Oracle: Larry Ellison", "IBM: Arvind Krishna"]
11. Test the application by considering some possible I/O
Pseudocode:
1. Initialize the list of seven tech-companies
2. Initialize a variable named found and define it to be false at the beginning.
3. Initialize a variable named hint and define it to be zero at the beginning.
4. Prompt user to enter the CEO/organization or press enter for a hint.
5. Check to see whether a hint is requested.
6. If so, display the 7 tech-companies and prompt the user again for the input.
7. Reset hint to 1.
8. Start for loop to iterate over the list items.
9. If the organization is present in the list, and the hint variable is 0
10. Print CEO and his/her organization
11. Reset flag variable to be True
12. If CEO is present in the list
Print CEO and his/her organization
14. Reset flag variable to be True
15. If flag variable is False
16. Print error message
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