Professional Documents
Culture Documents
Challenge
Problem Statement 1
• Detect the error in the flowchart
that represents the process of answering an
incoming telephone call either directly or by
using voicemail. In addition, draw the
correct flowchart.
Solution
• A flowchart can have only one Stop symbol representing the end of a process. If a
step leads to the end in the middle of a process, it can be connected to the end of
the process using flow lines.
Solution (Contd.)
Problem Statement 2
• Vaccination camps need to be organized to provide free vaccination to children
below five years of age. To organize these vaccination camps, a population survey
needs to be conducted. This will help the hospital staff to determine the
approximate number of vaccines that should be supplied to the camps. Children
who are below the age of five years, do not have any disease, and are born in
families below the poverty line will be given free vaccinations. Families that have
an annual income of less than $4500 will be assumed to be below the poverty line.
Which technique will you use to represent the algorithm for this problem? Give a
rationale for your choice, and represent the algorithm using the selected technique.
Solution
• The algorithm should be represented using a decision table. This is because
decision tables are preferred for cases when the problem consists of multiple
conditions based on which a decision is made.
• If you create a flowchart for this problem, it will have a too many flow lines which
will make the flowchart difficult to understand.
Solution (Contd.)
Problem Statement 3
• Global Manufacturers Company services and repairs cars and has many workshops
worldwide. When a car is brought for service to a workshop of Global Manufacturers
Company, it is sent to the servicing department. However, if it is damaged and is
brought for repairs, it is sent to the repairing department. After completing the
servicing or repairing of the car, a supervisor inspects it and the car is returned to
the customer.
Solution
Problem Statement 4
• The management of Heritage Company decides to provide House Rent Allowance
(HRA) to its employees. The criteria for calculating the HRA amount is:
• If the basic salary of an employee is greater than $10,000, the HRA given to
the employee will be 30 percent of the basic salary.
• If the basic salary of an employee is equal to or less than $10,000, the HRA
given to the employee will be 20 percent of the basic salary.
Solution
• The complete algorithm is:
• Step 1: Start
• Step 2: Accept the employee’s basic salary
• Step 3: If the employee’s basic salary is greater than $10000,
calculate the HRA as 30% of the employee’s basic salary
• Step 4: Otherwise, calculate the HRA as 20% of the employee’s basic salary
• Step 5: Display the HRA amount
• Step 6: Stop
Problem Statement 5
• Brilliants University displays the final results of the examinations on their Web site.
To view the results, students need to enter their roll numbers at the Web site. If a
student scores above 50 percent, the result is displayed as Passed, along with the
scores. Otherwise, the result is displayed as Failed. The following pseudocode is
created to represent the algorithm. However, the pseudocode has errors in it.
Correct the pseudocode, and create a flowchart for the algorithm.
begin
display “Enter your roll number”
accept StudentRollNumber
display StudentRollNumber and “Passed”
if student score is less than 50%
display StudentRollNumber and “Failed”
end
Solution
The correct pseudocode is:
begin
display “Enter your roll number”
accept StudentRollNumber
read Score from database
if student Score is greater than 50%
begin
display StudentRollNumber, “Passed”
display Score
end
else
begin
display StudentRollNumber, “Failed”
display Score
end
end
Solution (Contd.)
• The flowchart is:
Problem Statement 6
• A bookstore is offering a discount on books. The books are divided into two
categories, A and B. The discount is only for the books in category A. If a customer
buys a book from category A, a discount of 10 percent is provided.
Solution
• The complete pseudocode is:
begin
display “Enter the category of book purchased”
accept the category of book
if the category of book is A
display “You get a discount of 10%”
if the category of book is B
display “There is no discount on this book”
end