Sei sulla pagina 1di 8

SEBERANG PERAI POLYTECHNIC

DEPARTMENT OF INFORMATION AND COMMUNICATION TECHNOLOGY

DFC 10042
PROBLEM SOLVING AND PROGRAM DESIGN

ASSESMENT PROBLEM BASED EXERCISE 1


NO REGISTRATION NAME
NO
1. 10DDT20F1042 SHIVASHANGKKAR A/L MURUGAN
2. 10DDT20F1031 SHARVEEN DEVAR
3. 10DDT20F1036 MUHAMMAD NUR SYAMEEL BIN
KUNCHALAVI
PROGRAMME DIPLOMA TEKNOLOGI MAKLUMAT (TEKNOLOGI DIGITAL)
CLO2: Demonstrate effective communication both on orally or in writing about problem
solving skills by using different types of programming tools to solve a given problem. (A3,
PLO4)

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

BMI = weight / height * height


 

Print BMI

End
Step 1: Specify The Problem.

Problem: Ms Alena wants to calculate her BMI


Identify the operator: modulus operator (=) and arithmetic
operator (/ , *)
Identify the formula : BMI = weight / height * height

Step 2: Analyze The Problem

Input: Read height, weight


Process: BMI = weight / height * height
Output: Print BMI

Step 3:Design The Algorithm


Algorithm
1) Input Read height, weight
2) Calculate
BMI=weight/height * height
3) Output Print BMI

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.

Problem: Find the hypotenuse


Identify the operator: modulus operator (=) and arithmetic
operator (+,2)
Formula need to be used : a2+b2=c2

Step 2: Analyze The Problem

Input: length a and length b


Process: hypotenuse, c=√a2+b2
Output hypotenuse, c

Step 3:Design The Algorithm

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

Potrebbero piacerti anche