Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Write a Java program the design the following calss: [4 marks] Build a class GymMember that has the following: a. Attributes: name (String), ID(int),

image text in transcribed
3. Write a Java program the design the following calss: [4 marks] Build a class GymMember that has the following: a. Attributes: name (String), ID(int), JoiningDate (Date class). Use this for date type: Date JoiningDate = new Date(int year, int month, int date) Refer to this site for details on how to use Date class in Java: https://www.geeksforgeeks.org/date-class-java-examples/ b. Build a constructor that accepts three parameter name, ID, and Joining date. Then initialize the objects' attributes. c. Build a default constructor with empty body and no parameters. d. In the main method, create two GymMember objects gl and g2 using value constructor with arguments (parameters); and print their ids. e. Also, in the main method, create a third GymMember object g3 using the default constructor. f. Call a method CheckJoiningDate() on this object g3. g. Print the result of CheckJoiningDate() method. h. In the GymMember class, build a method named CheckJoiningDate0 that has no parameters. The method checks the joining date of this object g3, and if the joining year 2019 or before; prints the following: "Congratulations, you've earned a free membership next month (

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

Students also viewed these Databases questions

Question

is Corporate stock an example of a real asset

Answered: 1 week ago