Category | Coursework | Subject | Programming |
---|---|---|---|
University | London Metropolitan University | Module Title | CS4001NT Programming |
Due Date | 16th of May 2025 at 11:59 PM |
Coursework Type | Individual |
Coursework Weight | This coursework accounts for 60% of the overall module grades. |
Submission Instructions |
Submit the following to the Itahari International College’s MST portal before 01:00 PM on the due date: Instructions:
|
Academic year | 2025 |
You are reminded that there exist regulations concerning plagiarism. Extracts from these regulations are printed overleaf. Please sign below to say that you have read and understand these extracts:
Section 2.3: “The following broad types of offence can be identified and are provided as indicative examples ….
Need plagiarism-free Answers for your college/ university Coursework
Order Non-Plagiarised CourseworkContract cheating (also known as assessment outsourcing, commissioning or ghost writing) is when someone seeks out another party, or AI generator service, to produce work or buy an essay or assignment, either already written or specifically written for them or the assignment to submit as their own piece of work.
Contract cheating undermines the integrity of the academic process and devalues the qualifications awarded by the university. Students are reminded that academic integrity is a fundamental principle of our institution. Engaging in contract cheating not only impacts the individual’s academic record but also the reputation of the university.
Students are encouraged to seek support if they are struggling with their coursework. The university offers a range of resources, including academic counselling, tutoring services, and workshops on study skills and time management. Utilising these resources can help students achieve their academic goals without resorting to dishonest practices.
Instances of contract cheating will be thoroughly investigated, and students found guilty will face the penalties outlined above. It is the responsibility of every student to ensure that their work is their own and to avoid situations that could lead to accusations of academic misconduct.
By adhering to these standards, students contribute to a fair and equitable academic environment, ensuring the value and recognition of their qualifications are maintained.
This assignment aims to implement a real-world problem scenario using the Object-oriented concept of Java that includes creating a class to represent a GymMember, together with its two subclasses to represent Regular Member and Premium Member, respectively.
The GUI part of the coursework focuses on expanding the project by integrating a new class to implement a graphical user interface (GUI). The goal is to create a system that stores Gym Member details within an ArrayList. This class will contain the main method and will be executed via the command prompt. Additionally, you are required to submit a report explaining the functionality and structure of your program.
Create a new project in Bluej and create three new classes (Gym Member, Regular Member and Premium Member) within the project. Regular Member and Premium Member are subclasses of the class Gym Member.
For the GUI implementation part, add a new class to your project named Gymgui. Once your solution is complete, submit the Gymgui.java file along with the GymMember.java, RegularMember.java, and PremiumMember.java files. Ensure that no other files from the project are included. Additionally, submit your report in PDF format.
You are developing a system to manage members of a gym that offers different membership plans and tracks attendance and loyalty points. Each member is identified by a unique ID and has personal details such as their name, location, phone number, email, membership start date, and membership plan. You have to keep track of how often members visit the gym (attendance) and their accumulated loyalty points.
NOTE: – The program should include the following classes (with no additional attributes or methods).
Hire Experts to solve this Coursework Before your Deadline
Buy Today, Contact UsThe GymMember is a parent class as an abstract class which has the following attributes with their respective data type and with a protected access modifier as mentioned below:
id – int
name – String location: String phone – String email – String gender – String
DOB – String
membership Start Date – String, attendance – int
loyalty Points – double
active Status – boolean
The constructor of this class accepts id, name, location, phone, email, gender, DOB, and membership Start Date as parameters. The attributes attendance and loyaltyPoints are initialised to zero, and the active Status is set to false. Additionally, assign id, name, location, phone, email, membershipStartDate, plan and price with the parameter values.
Each attribute has a corresponding accessor method.
An abstract method, mark Attendance (), is created to track the attendance of the member.
A method activateMembership() sets activeStatus to true when the membership needs to be activated or renewed, and a method deactivateMembership() sets the activeStatus to false if the membership needs to be deactivated or paused.
[Note: The membership must be activated first to deactivate. Also, the membership is deactivated by default.
Also, the method reset Member() is created to set the activeStatus of the member to false, attendance is set to zero and loyaltyPoints to zero.
A display method should output (suitably annotated) the ID, name, location, phone, email, gender, DOB, membership Start Date, attendance, loyalty Points and active Status.
The Regular Member class is a subclass of the GymMember class, and it has six private attributes with the following data types:
attendanceLimit – int (final)
isEligibleForUpgrade – boolean
removalReason – String
referralSource – String
plan – String
price – double
The constructor accepts nine parameters which are id, name, location, phone, email, gender, DOB, membershipStartDate and referralSource. A call is made to the superclass constructor with eight parameters. The attribute isEligibleForUpgrade is set to false, attendanceLimit is set to 30, plan is set to basic, price is set to 6500 and removalReason is set to empty. Also, assign other attributes with corresponding parameter values.
Each attribute of RegularMember class has a corresponding accessor method.
Implement the abstract method markAttendance() to increment the attendance value by 1 each time this method is invoked. Also, the loyaltyPoints should be increased by 5 points.
There is a method named getPlanPrice() with return type double to retrieve the price of the provided plan. This method accepts plan as a parameter and returns its corresponding price. The following are the pricings of available gym plans:
basic 6500
standard 12500
deluxe 18500
The switch statement must be implemented for this specific scenario to return the corresponding plan’s price.
[Note: if the invalid plan is passed as an argument then the getPlanPrice() method should return -1]
There is a method upgradePlan() with return type String. This method is used to upgrade the plan subscribed by the member. The method accepts plan as a parameter. If the member is eligible for upgrading the plan, then the plan and price should be updated accordingly by calling getPlanPrice() method.
Also, the system should validate and display an appropriate message if the same plan is chosen that the member is currently subscribed to.
Note: If getAttendance() >= attendanceLimit then set isEligibleForUpgrade to true
[Hint: if the method get PlanPrice() returns -1, then an appropriate message should be displayed. The upgradePlan() method should return the appropriate message, as the return type of the method is String.
Now, create the revertRegularMember() method, which accepts removalReason as a parameter. A super class method: reset Member() is called here, and isEligibleForUpgrade is set to false, plan is set to basic and price is set to 6500. Also, assign other attributes with corresponding parameter values.
A method to display the details of the Regular Member is required. It must have the same signature as the display method in the parent class. It will call the method in the super class to display all the attributes of the super class. Also, display the value of attributes: plan and price. Additionally, display the removalReason if its value is not empty.
The PremiumMember class is a subclass of the GymMember class, and it has three attributes:
premiumCharge – double(final)
personalTrainer – String
isFullPayment – boolean
paidAmount – double
discountAmount – double
The constructor accepts nine parameters which are id, name, location, phone, email, gender, DOB, membershipStartDate, and personalTrainer. A call is made to the superclass constructor with eight parameters. The attribute premiumCharge is set to 50,000, paidAmount is set to 0, and isFullPayment is set to false, and discountAmount is set to zero. Also, assign other attributes with corresponding parameter values.
Each attribute of PremiumMember class has a corresponding accessor method. Here, a method payDueAmount() of return type String is created to pay the due amount. It accepts paidAmount as a parameter. Received paidAmount from the parameter should be added on paidAmount attribute.
Following validations should be made inside this method:-
if payment is already full (this.isFullPayment == true),a suitable message should be displayed and returned.
if the total paid amount is more than the premium charge, a suitable message should be displayed and returned.
Now, If the payment is successful, a suitable message should be displayed and returned, including the remaining amount to be paid. The value of isFullPayment will also be updated accordingly.
[remainingAmount = premiumCharge – this.paidAmount]
[Hint: if the total paidAmount is equal to the premiumCharge, then isFullPayment should be set to true, otherwise false.]
There is a method named calculateDiscount(). This method is used to calculate discount amounts based on payment status. If the payment is full then the premium member will get a 10% discount on the premium plan’s charge, otherwise, there will be no discount. Here, if the discount is calculated successfully, the value of the discountAmount attribute will be updated, and a suitable message will be displayed.
[Note: If isFullPayment == true then discountAmount = 10% of plan’s price]
Create a method named revertPremiumMember() which calls the super class resetMember() method. Additionally, the value of personalTrainer is set to empty, isFullPayment is set to false, and paidAmount and discountAmount are set to zero.
A method is required to display the details of the PremiumMember, and it must have the same signature as the display method in the parent class. It will call the method in the super class to display all the attributes of the super class. Additionally, it should display the value of personalTrainer, paidAmount and isFullPayment. Also, the remaining amount to be paid should be calculated and displayed with a suitable annotation. Also, discountAmount will only be displayed if the payment is done completely.
[ Hint: remainingAmount = premiumCharge – this.paidAmount ]
Your GUI should include the same components, but you have the flexibility to choose a different layout if it enhances aesthetics or usability. The GymGUI class must maintain an ArrayList (not a simple array) of the GymMember class, which will hold both RegularMember and PremiumMember objects.
[Note: Only one ArrayList should be created.]
There should be following text fields for entering:
1. Id
2. Name
3. Location
4. Phone
5. Email
6. Gender
7. DOB
8. Membership Start Date
9. Referral Source
10. Paid Amount
11. Removal Reason
12. Trainer’s Name
Also, there should be a non-editable text field for regular plan price, premium plan charge and discount amount.
The gender should be displayed as a radio button.
The Plan (Basic, Standard, Deluxe) attribute should be displayed as a JComboBox for plan selection for regular members only.
10
The GUI should have the following buttons to perform specific task:
1. Add a Regular Member
When this button is pressed, the input values from the text fields (ID, Name, Location, Phone, Email, Gender, DOB, Membership Start Date,Referral Source) will be used to create a RegularMember object. This object will then be added to an ArrayList of the GymMember class.
Note: Member ID duplication is prohibited. Each member, whether Regular or Premium, must have a unique Member ID]
2. Add a Premium Member
When this button is pressed, the input values from the text fields (ID, Name, Location, Phone, Email, Gender, DOB, Membership Start Date, Personal Trainer) will be used to create an object of Premium member and this object will then be added to an ArrayList of the GymMember class.
[Note: Member ID duplication is prohibited. Each member, whether Regular or Premium, must have a unique Member ID.]
3. Activate Membership
The Member Id should be entered in the GUI to activate membership. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system, then call the method to activate membership from GymMember class.
4. Deactivate Membership
The Member Id should be entered in the GUI to deactivate membership. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system, then call the method to deactivate membership from GymMember class.
5. Mark Attendance
First, the Member Id should be entered in the GUI to mark attendance. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system, then call the method to mark attendance from GymMember class.
[Note: if only active status of member is true, proceed with mark attendance] 6. Upgrade Plan
The Member Id is entered, and the required Plan selected in the GUI. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system, then call the method to upgrade plan from RegularMember class. Upgrading the plan is only possible if the member is active.
[Hint: An object of GymMember is cast as RegularMember.]
7. Calculate Discount
To calculate a discount, the Member Id is entered. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system, then call the method to calculate discount from PremiumMember class.
[Hint: An object of GymMember is cast as RegularMember.]
8. Revert Member
To remove a member, the MemberID is entered in the GUI. When this button is pressed the, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system and then call the method to revert member from both RegularMember and PremiumMember class.
[Note: there should be two separate buttons for reverting the members of each class]
Get the Solution of this Coursework
Order Non Plagiarized Coursework9. Pay Due amount
To pay the due amount, the MemberID , and amount to be paid is entered in the GUI. When this button is pressed, the input value of Member Id is compared to the existing Member Id. If the entered Member Id is valid and exists in the system and then call the method to pay the due amount of the Premium gym member.
10.Display
When this button is pressed, the information of all the members of the respective class should be displayed in a separate frame/panel in the GUI.
11. Clear
When this button is pressed the entered values from text fields should be cleared and the check box should be unchecked.
12.Save to File
When this button is pressed all the member details stored in the arraylist should be written to file named “MemberDetails.txt” as shown in the figure below:
[Hint:- You can use this string format as reference and adjust accordingly: String.format(“%-5s %-15s %-15s %-15s %-25s %-20s %-10s %-10s %-10s %- 15s %-10s %-15s %-15s %-15s\n”, “ID”, “Name”, “Location”, “Phone”, “Email”, “Membership Start Date”, “Plan”, “Price”, “Attendance”, “Loyalty Points”, “Active Status”, “Full Payment”, “Discount Amount”, “Net Amount Paid”); ]
13. Read from File
When this button is pressed, all the member details written in a text file should be read and displayed in a separate frame/panel in an organised format.
14
Additional Information to be included:
Report (44 marks)
Your report should describe the process of development of your classes with:
a. A class diagram for each of the classes and a combined one showing the relationship among them. [5 marks]
b. Pseudocode for the methods of each class
[Note:- don’t include getter/setter methods] [8 marks] c. A short description of each method of the given classes. [8 marks]
d. You should give evidence (through inspection tables and appropriate screenshots) of the following testing that you carried out on your program:
Test 1: Compile and run the program using the command prompt/terminal. [1 mark] Test 2: Adding a regular member and a premium member respectively.[2 marks] Test 3: Test case for mark attendance and upgrade plan. [4 marks] Test 4: Test case for calculating discount, paying the due amount and reverting members. [4 marks]
Test 5: Test case for saving and reading from a file. ` [3 marks]
e. The report should contain a section on error detection and error correction, where you give examples and evidence of three errors encountered in your implementation. The errors (syntax, semantic or logical errors) should be distinctive and not of the same type. [3 marks]
f. The report should contain a conclusion, where you need to include the following things:
Evaluation of your work,
Reflection on what you learned from the assignment,
What difficulties do you encounter, and
How do you overcome the difficulties? [4 marks]
The report should include a title page (including your name and ID number), a table of contents (with page numbers), an introduction part that contains a brief about your work, and a listing of the code (in an appendix). Marks will also be awarded for the quality of writing and the presentation of the report. [3 marks]
If you are stressed about the coursework on CS4001NT Programming, then there is no need to worry now! Whether you need Programming Assignment Help or Marketing Assignment Help, you will get expert guidance and help on report writing services, which will make your concepts strong. We also provide you with free coursework solutions that will help you understand. And the best part? All the content is 100% original, written by PhD expert writers, and is well-researched, so that you get the best quality. So don't delay now, boost your grades with our help!
If you want to see the related solution of this brief then click here:-Programming
Let's Book Your Work with Our Expert and Get High-Quality Content