Program Specification
Program Specification
Program Procedures:
1. Prompt the user to input personal information including first name, last
name, gender, height (in inches), and weight (in pounds).
2. Present the user with options to input either their approximate age or
their date of birth.
3. Based on the user's choice, input the age or date of birth and create a
HealthProfile object.
4. Calculate and display the individual's age, maximum heart rate, target
heart rate range, and BMI using the HealthProfile object.
5. Provide BMI reference values to compare the calculated BMI.
6. Ensure proper error handling and input validation throughout the
program.
7. Display the results in a clear and understandable format.
Algorithm/Processing/Conditions:
Inputs:
Processes:
Page 1 of 3
Program Requirements Document
Thursday, December 26, 2024
Outputs:
Display the results of the health profile analysis in a clear and understandable
format. Provide BMI reference values for the individual's BMI category
comparison. Ensure proper error handling and input validation for all user
inputs and calculations to handle invalid input gracefully.
All input data should be validated to ensure it meets the expected format and
ranges. For example, height and weight should be positive numbers, and the
date of birth should be in the format "YYYY-MM-DD". Handle exceptions
gracefully and provide clear error messages to the user in case of invalid input
or calculation errors. Ensure that the program follows good coding practices,
including proper indentation, naming conventions, and comments where
necessary to enhance readability and maintainability. Use appropriate data
types and structures to store and manipulate the input data and calculate results
efficiently. Provide options for the user to repeat the process or exit the
program after viewing the health profile results. Follow the specified
algorithms for input, processing, and output steps to ensure consistency and
correctness in the program flow. Test the program thoroughly with various
input scenarios, including edge cases and boundary conditions, to validate its
functionality and robustness. Document the program's functionality, including
its purpose, input requirements, processing steps, and output format, to
facilitate understanding and future maintenance.
Comments:
Page 2 of 3
Program Requirements Document
Thursday, December 26, 2024
Page 3 of 3