logo

User and Technical Documentation for Health Club Membership Calculator Program

   

Added on  2023-06-10

26 Pages5023 Words395 Views
Assignment
User and Technical Documentation for Health Club Membership Calculator Program_1
Contents
Task 1....................................................................................................................................................2
a) Produce user documentation for the above completed programming application including the
user interface design and additional/enhanced program comments wherever necessary...............2
b) Develop technical documentation for the above program application for ease of maintenance. 6
Task 2..................................................................................................................................................12
a) Amend the above program to demonstrate discrimination between semantic and syntax errors.
.........................................................................................................................................................12
b) Design and justify a testing strategy for normal, extreme and exceptional tests for each item of
functionality.....................................................................................................................................15
c) Amend the above program and construct test data and schedules to detect at least three logic
errors...............................................................................................................................................16
d) Use appropriate techniques for detecting errors in (b) and (c) with sample screenshots. Where
appropriate, detail any major action that you have taken in light of the testing............................19
User and Technical Documentation for Health Club Membership Calculator Program_2
Task 1
a) Produce user documentation for the above completed
programming application including the user interface design
and additional/enhanced program comments wherever
necessary.
Solution:
User Documentation:
Graphical User interface:
Command Line interface:
User and Technical Documentation for Health Club Membership Calculator Program_3
Program with Comments:
// FILE: healthclub.cpp
// TITLE: Health Club Membership
// SUBMITTED BY:
// FOR COURSE:
// DATE:
// PURPOSE:
// This is a menu-driven program that helps users
// to calculate membership fees based on the membership type
// and duration of the membership
// header files need for the application
#include <iostream>
#include <iomanip>
using namespace std;
// Function prototypes
// Function to be used are declared here
void showMenu();
void showFees(double, int);
// main method of the program
// all other method are called from this method
int main()
{
int choice; // To hold a menu choice
int months; // To hold a number of months
// Constants for the menu choices
const int ADULT_CHOICE = 1,
CHILD_CHOICE = 2,
SENIOR_CHOICE = 3,
QUIT_CHOICE = 4;
// Constants for membership rates
const double ADULT = 40.0,
CHILD = 20.0,
SENIOR = 30.0;
// Set up numeric output formatting.
cout << fixed << showpoint << setprecision(2);
// to keep running the program until (4) Quit option
// is selected
do
{
// Display the menu and get the user's choice.
showMenu();
cin >> choice;
User and Technical Documentation for Health Club Membership Calculator Program_4
// Validate the menu selection.
while (choice < ADULT_CHOICE && choice > QUIT_CHOICE)
{
cout << "Please enter a valid menu choice: ";
cin >> choice;
}
// If the user does not want to quit, proceed.
if (choice != QUIT_CHOICE)
{
// Get the number of months.
cout << "For how many months? ";
cin >> months;
// Display the membership fees based on the user input.
switch (choice)
{
case ADULT_CHOICE:
showFees(ADULT, months);
break;
case CHILD_CHOICE:
showFees(CHILD, months);
break;
case SENIOR_CHOICE:
showFees(SENIOR, months);
break;
}
}//correction
} while (choice!= QUIT_CHOICE);//correction
return 0;
}
//*************************************************************
// Definition of function showMenu which displays the menu.
// Displays the list of Memberships offered at the Club
// Provides user with menu option to select from.
//*************************************************************
void showMenu()
{
cout << "\n\t\tHealth Club Membership Menu\n\n"
<< "1. Standard Adult Membership\n"
<< "2. Child Membership\n"
<< "3. Senior Citizen Membership\n"
<<"4. Quit the Program\n\n"
<< "Enter your choice: ";
}
User and Technical Documentation for Health Club Membership Calculator Program_5
//*************************************************************
// Definition of function showFees. The memberRate parameter *
// holds the monthly membership rate and the months parameter *
// holds the number of months. The function displays the total*
// charges.
// Calculates total charges by multiplying membership rate with
// total month for which the member ship is taken and
// display the total charges calculated to the console.
//*************************************************************
void showFees(double memberRate,int months) //correction
{
cout << "The total charges are $"
<< (memberRate * months) << endl;
}
Guide to run the program:
1. Compile and run the program
2. Select the membership by pressing 1 for Standard Adult Membership, 2 for child
membership, 3 for Senior Citizen member ship.
3. After enter the valid membership.
4. Enter duration in months.
5. The program will display the Total charges for the enter membership and duration.
6. Select option 4 from the menu to quit or stop the program.
User and Technical Documentation for Health Club Membership Calculator Program_6

End of preview

Want to access all the pages? Upload your documents or become a member.