Ask a question from expert

Ask now

NIT5150 The Gym Membership Calculator (Doc)

6 Pages638 Words45 Views
   

VICTORIA UNIVERSITY

   

Advanced Object Oriented Programming (NIT5150)

   

Added on  2020-05-28

NIT5150 The Gym Membership Calculator (Doc)

   

VICTORIA UNIVERSITY

   

Advanced Object Oriented Programming (NIT5150)

   Added on 2020-05-28

BookmarkShareRelated Documents
Running head: GYM MEMBERSHIP CALCULATORGym Membership Calculator Name of the Student:ID of the Student:Name of the University:Author note:
NIT5150 The Gym Membership Calculator (Doc)_1
1GYM MEMBERSHIP CALCULATORCode ExplanationThe Gym Membership Calculator is designed with the motive to calculate themembership charges of a particular number of members. Each member enters their number ofweeks and the discounts if they have any. The calculation is then done based on the requirementguideline. Later a statistical data is also presented.For each member, an object is created and put into an object array. Each object has themember’s name, weeks and discount status. As the user enters values for each member, theircharges is calculated through the calculate() function. However, the program also checks forinput validity. This prevents the user from entering wrong values. An error message is printedand the user is asked to re-enter the asked field’s value. The recursion is achieved using awhile(true) loop block, which breaks if a valid input is entered. The validity of discount statusentry is also checked. To add more reality, a check is also kept to assure that the user must entera name for the members. The price tag is checked using multiple Conditional statements and thediscount is subtracted if necessary. The data of each object is then printed in a tabular format. Oncompletion of each input and charges output process, the program checks for the maximum andminimum spender in the Gym. This is achieved with two max and min variables that updatethemselves as the user enters values for each member. Later these values are printed accordingly.
NIT5150 The Gym Membership Calculator (Doc)_2
2GYM MEMBERSHIP CALCULATORTesting and OutputTest case 1 (Member 1): to check if the program is performing normally with normal entry ofvalue. The discount factor is also checked.Test case 2 (Member 2): Checks if the program can handle week’s value that is below 1.Test case 3 (Member 3): Checks if the program can handle week’s value that is above 30.Test case 4 (Member 4-5): Checks the case sensitivity of the discount status entry.Test case 5 (Member 6): Checks if the price tag works properly for the 9 to 16 range.Test case 6 (Member 7): Checks if the price tag works well for the >16 range.Test case 8 (Member 8): Checks if the program can handle the situation if no name is entered.Also does this ensure that the price tag works properly for weeks below 8.Test case 9 (Member 9): Checks if the discount status entry can handle errors due to entry otherthan “yes” or “no”.Test case 10: It is also noticed that the table displays the membership data accurately for eachmember.Test case 11: The statistically collected data of who has spent the most and the least of amount isdisplayed properly along with the number of members who have applied for more than and lessthan 8 weeks.
NIT5150 The Gym Membership Calculator (Doc)_3

End of preview

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

Related Documents
The deposit amount and duration were checked
|9
|798
|10

Programming
|5
|531
|69

Design Documentation Pseudo Code BEGIN Display Welcome message BEGIN
|13
|1512
|68

SEO for Desklib
|2
|890
|424

Questions on Stack Program
|11
|1305
|31

Employee Salary Calculator
|8
|1084
|42