Quiz 1 Answer

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Quiz 1 Answer as PDF for free.

More details

  • Words: 165
  • Pages: 2
ITD 1124 :: C++ Programming

QUIZ 1 Algorithm 1. Firstly, input the value of Weight and Height 2. Calculate by using this formula; BMI = Weight (kg)/ (Height (m)X Height(m)) 3. From BMI value, please determine message of indicates 4. If BMI value is below 18 then display “Slim” message 5. If BMI value is between 18 and 25 then display “Ideal” message 6. If BMI value is over 25 then display “Fat” message 7. Else display “Invalid value” message 8. Display BMI value Pseudo-code START INPUT

Weight, Height

PROCESS

BMI = Weight (kg)/ (Height (m)X Height(m))

OUTPUT

IF

BMI<18 THEN DISPLAY “Slim”

ELSEIF

BMI>=18 && BMI<=25 DISPLAY “Ideal”

ELSEIF

BMI>25 THEN DISPLAY “Fat”

ELSE

DISPLAY “Invalid value”

BMI

END

Prepared by Izwan Suhadak Ishak

THEN

ITD 1124 :: C++ Programming

Flow Chart Start

Weight, Height

BMI= Weight / (Height * Height);

True Slim

BMI<18

False BMI>=18 && BMI<=25

True Ideal

False True BMI>25

False Invalid value

BMI

End

Prepared by Izwan Suhadak Ishak

Fat

Related Documents