Assignment 1 – Practical Programming Project
Objectives
This assessment is designed to assess your understanding of variables, constants, types, operators, input/output, loops, if statements, classes, objects and functions.
Task
Create a C# application that calculate and displays membership fees for N customers who registered for membership from a sport center based in Victoria, Australia. Declared a constant variable M to be equal to the largest digit of your student id number (e.g. if your student id is s3025423 then M should be equal to 5). Assume M=4, if the largest digit of your student id number is less than 4. The standard charges of membership are shown below
Length of Membership | Rate (including tax) |
1-6 months | $30.0 per month |
6-12 months | $27.5 per month |
More than 12 months | $25.0 per month |
Specific Requirements
3
Gym Membership Calculator
How the Program works
1. We have a single cs file which has two classes MemberMain and Customer.
2. Customer class has three attributes consumerName, membershipMonths and discountedConsumer
* consumerName : name of Customer
* membershipMonths : months of membership for this consumer
* discountedConsumer : whether discount will be given to this customer or not
3. MemberMain class makes an object of MemberMain and call various methods.
We compile the program by mcs Member.cs And run it by mono Member.exe
Screenshots
Test Plan
Result Test Plan
# | Consumer Name | # of Weeks | Discount Given ? | Expected Output | Actual Output | Result |
1 | test1 | 10 | NO | 275 | 275 | Pass |
2 | test2 | 10 | YES | 233.75 | 233.75 | Pass |
3 | test3 | 5 | NO | 150 | 150 | Pass |
4 | test4 | 5 | YES | 127.5 | 127.5 | Pass |
5 | test5 | 40 | NO | 1000 | 1000 | Pass |
6 | Test 6 | 40 | YES | 850 | 850 | Pass |
Validation Test Plan
# | Case | Expected Output | Actual Output | Result |
7 | # of Weeks : -3 | Error message and ask user to reenter | Error message and ask user to reenter | Pass |
8 | # of Weeks : 75 | Error message and ask user to reenter | Error message and ask user to reenter | Pass |