Week 4 Tasks

Decision Making

Task 16

Write an algorithm and program to find if the entered character is a vovel or not.

Vovels : a,e,i,o,u

Task 17

Draw a flowchart and program to convert a lower case character to uppercase and vise-versa.

Hint: Use ASCII Table

>> Click Image <<

Task 18 (Experiment 7)

WAP to check if the year entered is a leap year or not.

Hint

A year is leap year if the following conditions are satisfied:

  • Year is multiple of 400. or
  • Year is multiple of 4 and not multiple of 100.

Task 19 (Experiment 8)

WAP to find the body mass index of the user when user enters height and weight. Also find the BMI category to which the user belongs with elseif ladder.

BMI Categories:

  1. Underweight = <18.5
  2. Normal weight = 18.5–24.9
  3. Overweight = 25–29.9
  4. Obesity = BMI of 30 or greater

Hint : $$ BMI = \frac{Weight}{Height^2} $$ Weight in Kg, Height in meters

Task 20 (Bonus Task)

WAP to read three integer values from the keyboard and displays the output stating that they are sides of right angled triangle or not.

For a right angled triangle to be valid it must satisfies the following criteria:-

  • a, b and c should be greater then 0.
  • Sum of any two sides of triangle must be greater than the third side.
  • Pythagorean Theorem i.e., $ a^2 + b^2 = c^2 $.