1. Other
  2. Other
  3. construct a solution algorithm for the following problems your question...

Question: construct a solution algorithm for the following problems your question...

Question details

Construct a solution algorithm for the following problems. Your question solution should contain: 

·       Defining problem 

·       Pseudo code algorithm
use as java code in eclipse

·       Desk check of the algorithm 

o   (Three test cases for each question)

o   (Two valid and one error test case if appropriate) 

____________________________________________________________________

The VO2Max score of an athletic reflects the physical fitness of an individual. It is the maximum capacity of an individual's body to transport and use oxygen during incremental exercise.

Kaplan Sports Club requires a Sports Recommender program to calculate the VO2Max of an individual and display the type of sport the athletic is suitable for. 

The Sports Recommender program use the following formula to calculate each athlete’s VO2Max in mL/(kg.min).

           

HRmax is the Maximum Heart Rate.  (HRmax = 220 – age) 
HRrest is the Resting Heart Rate. 

The program is to accept the HRrest , age, gender of the athletic and display the type of sports that athletic is suitable for based on the following table :

Sport

Age ( yrs )

Males ( VO2Max)
mL/(kg.min)

Females ( VO2Max)
mL/(kg.min)

Basketball

18 – 30

40 – 60

43 – 60

Bicycling

18 – 26

62 – 74

47 – 57

Canoeing

18 – 26

55 - 67

47 – 67

Gymnastics

18 – 22

52 – 58

36 – 50

Swimming

10 – 25

50 - 70

40 – 60

The program needs to be ‘smart’ enough as well. When inappropriate values are entered to the program, for example, a negative age, then the program print an print error message and ask the operator to enter the value again. 

Error check required: 

  • Negative HRrest and age. 
  • Gender is invalid. 

 

answer for below two have similiar same as exmaple answer.

Defining problem 

·       Pseudo code algorithm
use as java code in eclipse

example answer :

Defining diagram :

 

Input

Processing

Output

 

Patient’s details

-       Name

-       Height

-       Weight

 

 

Display Heading

Read patient’s detail

Calculate BMI

Print BMI value and patient’s status.

 

 

Patient’s details

-       BMI value

-       Patient’s status

 

 

Solution algorithm :

 

Print_BMI_results

            Display ‘BODY MASS INDEX’ heading

            DOWHILE more records exist

                        Read patient detail

                               BMI = (Weight_kg/ ((Height_cm ^2)*0.0001))

                        IF BMI <= 24 THEN

                                    status = ‘Under Weight’

                        ELSE IF BMI >= 29 THEN

                                    status = ‘Healthy’

                        ELSE IF BMI >= 34 THEN

                                    status = ‘Overweight’

                        ELSE IF BMI > 34 THEN

                                    status = ‘Obese’

            

                        ENDIF

                        Display patient_BMIValue, patient_status

            ENDDO

END

Solution by an expert tutor
Blurred Solution