SWC2483 Week 7 Class Exercise

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

WEEK 7 CLASS EXERCISE (1 HOUR)

FRIDAY | 23/2/2024 | SUBMIT BY 5 PM THROUGH GOOGLE FORM


STUDENT NAME: STUDENT ID:
Question 1
Objective- Write java program based on flowchart.
You are required to translate the following flowchart into a pseudocode. Then, write a Java
program based on the given flowchart.

1
Answer:

2
Question 2

Objective- Writing flowchart and pseudocode.

i. Identify the input-process-output for the problem below.


ii. Design the algorithm in pseudocode for the problem below.
iii. Translate the pseudocode into flowchart.
BMI weight problem
Write a program that reads a person’s height in feet and inches and weight in pounds and
compute the Body Mass Index (BMI) for the person. The program will determine the Body
Mass Index (BMI) score and display an appropriate status message according to the score
table given below.

The BMI score means the following:

Status BMI
Underweight Below 18.5
Normal 18.5 – 24.9
Overweight 25.0 – 29.9
Obesity 30.0 and above

Answer:

3
Question 3

Objective- To write a Java program that capable to obtain input using JOptionPane class
and display the output.

Write a Java program that input value of the test data below, then display the results of sum,
subtract, multiply, and divide. Use the test data below as an example in your program.
Test Data:
Input first number: 125
Input second number: 24
Screenshot your program & the output and paste it here:

4
5
Question 4
Objective- To write a Java program that capable to obtain input using Scanner class and
display the output.

Based on table of MUET scoring below, write a program that will ask the lecturer to enter a
mark, then display the band that they will gain.

Aggregated score Band


331- 360 6.0
294- 330 5.0
258- 293 4.5
211- 257 4.0
164- 210 3.5
123- 163 3.0
82- 122 2.5
36- 81 2.0
1- 35 1.0

Use the test data below as an example in your program.


Test Data:
 335
 300
 288
 215
 199
 150
 0
 40
 2
Screenshot your program & the output and paste it here:

6
-END-

You might also like