cHcw08bmiSDP

Embed Size (px)

Citation preview

  • 8/9/2019 cHcw08bmiSDP

    1/3

    Coursework Task

    Higher Computing Coursework Task 2007-2008

    Part 1

    The Scot Fit Club wants to use a computer program to monitor the health of club members by

    recording their heights and weights and calculating each members Body Mass Index (BMI), using thefollowing table to categorise their condition.

    Body Mass Index Table

    Underweight BMI=185 and =25

    The program will then calculate and display the number of people in each category so that suitable

    activities can be planned for members.

    The program will be tested using the details of 5 club members.

    How the program should work:

    Entering weight and height details

    The members weights (in kilograms) and heights (in metres) entered into the system must be greaterthan 0.

    The data on the 5 club members weights and heights which should be used in testing the program isgiven below.

    You may use any suitable method available in your programming environment to enter this data into

    the system.

    Test Data

    Height in metres Weight in kilograms

    16 623

    17 733

    13 440

    14 58116 472

    Calculating the BMI

    The program will calculate the BMI of each of the club members using the following formula.

    2

    (Weight in kilograms)BMI =

    (Height in metres)

    Scottish Qualifications Authority 7Coursework Task C206/12Higher Computing 2007/2008

  • 8/9/2019 cHcw08bmiSDP

    2/3

    Scottish Qualifications Authority 8Coursework Task C206/12Higher Computing 2007/2008

    Storing the BMI data

    The data on club members should be stored in a suitable data structure.

    Calculating the number of club members in each BMI category

    The program should then calculate the numbers of club members in each category.

    Displaying the numbers in each BMI category

    The output from the program should be in a table similar to the following:

    Height in metres Weight in kilograms BMI

    16 623 24317 733 254

    13 440 26014 581 296

    16 472 177

    Club Members Weight Analysis

    Category Number of members

    Underweight 1Ideal weight 1

    Overweight 3

    Note: the height, weight and BMI should be displayed to one decimal place.

  • 8/9/2019 cHcw08bmiSDP

    3/3

    Scottish Qualifications Authority 9Coursework Task C206/12Higher Computing 2007/2008

    Algorithm

    1. Loop for all members2.

    Enter valid height and weight3. Calculate and store BMI

    4. End loop5. Calculate the number of members in each BMI category6. Display height, weight and BMI of all members and the number of members in each BMI

    category

    What you have to do:

    Tasks Evidence required Marks

    1 Indicate data flow on the algorithm. Algorithm with data flow.3

    2 Refine steps 2, 5 and 6 of the algorithm. Pseudocode for steps 2, 5and 6. 6

    3 Using a software developmentenvironment of your choice, implement the

    algorithm.

    Use separate sub-programs whereappropriate.

    Use parameter passing where appropriate.

    Listing of implementedprogram.

    17

    4 Test the program to ensure that it is robustand fit for purpose.

    Hard copy of test results.

    2

    5 Evaluate the program for robustness andefficiency.

    Brief report on test

    results. 2