Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DFC 10042
PROBLEM SOLVING AND PROGRAM DESIGN
INSTRUCTIONS:
Answer ALL question. Students are required to discuss and perform an oral presentation
using PowerPoint slides and hardcopy submission for the given question. The presentation
will be done in group of 3 (three). The presentation MUST be between 15 - 20 minutes. Once
the student has finished the presentation, there will be a Question & Answer period, in which
any student can take part and during which the lecturer will ask relevant questions or request
clarification/explanation of topics arisen during the presentation. Students will be evaluated
according to a Rubric that enclosed with the questions.
QUESTION 1
Ms Alena wants to calculate her BMI according to the flow chart shown below. As a programmer, solve this
problem-using step 1 until step 3 in Programming Life Cycle. Explain the steps involved in Programming Life
Cycle to solve this problem. [CLO2:A3]
Start
Read height,
weight
Print BMI
End
Step 1: Specify The Problem.
Pseudo Code
Start
Input Read height, weight;
Calculate: BMI=weight/height * height;
Output Print BMI;
End
Flowchart
QUESTION 2
Derived from the Pythagorean Theorem, the distance formula is used to find the distance between two points in the plane. The
Pythagorean Theorem, a2+b2=c2, is based on a right triangle where a and b are the lengths of the legs adjacent to the right angle, and c is
the length of the hypotenuse.
As a programmer, solve this problem-using step 1 until step 3 in Programming Life Cycle. Explain the steps involved in Programming Life
Cycle to solve this problem. [CLO2:A3]
Step 1: Specify The Problem.
Algorithm
1)Input length a and length b
2)Calculate : length hypotenuse , c=√a2+b2
3)Output hypotenuse, c
Pseudo Code
Start
Input length a and length b;
Calculate hypotenuse, c=√a2+b2;
Output hypotenuse, c;
End
Flowchart