Reference no: EM132071372
Introduction to Programming
Log/Workbook Assessment
Question one
Write a java program the accept four student's marks: Quiz(Q) test, Mid-Semester (MS), Applied Project (AP) and Final test (FT). The student should enter the marks using keyboard. The weight for each assessment is shown in Table (1) as follows:
Assessment
|
Weight
|
Quiz
|
10%
|
Mid-Semester Test
|
20%
|
Applied Project
|
40%
|
Final Test
|
30%
|
Table 1: Assessment Overview
The final make can be calculated as:
Final Mark (FM)=0.1*(Q)+0.2*(MS)+0.4*(AP)+0.3*(FT)
The program should calculate final marks and display the letter grade that is assigned for the final mark. Use the grading scheme in Table 2.
Final Mark (FM)
|
Letter Grade
|
90-100
|
A
|
80-89
|
B
|
70-79
|
C
|
60-69
|
D
|
Below 60
|
F
|
Table 2: Grading Scheme
Question two (5 marks)
A Community health centre wants to use Body Mass Index (BMI) to find the ideal body preparation for the centre's clients. You have recently hired to develop a Java application to calculate the BMI. In this application, the client has to enter first name, last name, weight, height and gender using keyboard. Your application must use the following equation to calculate the BMI:
BMI= W / H2
Where, W is the weight in kilograms and H is the height in meter. The BMI estimates whether the client is underweight, acceptable weight, overweight, obese, or morbidly obese according to the following table
Result
|
BMI (Female)
|
BMI (Male)
|
Underweight
|
Less than 19
|
Less than 20
|
Acceptable
|
Greater than or equal to 19 and less than 25
|
Greater than or equal to 20 and less than 25
|
Overweight
|
Greater than or equal to 25 and less than 30
|
Greater than or equal to 25 and less than 30
|
Obese
|
Greater than or equal to 30 and less than 40
|
Greater than or equal to 30 and less than 40
|
Morbidly Obese
|
Greater than or equal to 40
|
Greater than or equal to 40
|
Table 3: The BMI result
For example, if a male client weight is 80 Kg and height is 1.6 meter. The BMI is about 31.25 and the result is "Obese".