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

![marks] Build a class GvmMember that has the following: a. Attributes: name](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f32099d6ba2_62566f3209951496.jpg)
3. Write a Java program the design the following calss: [4 marks] Build a class GvmMember 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 GvmMember objects g1 and g2 using value constructor with arguments (parameters); and print their ids. e. Also, in the main method, create a third GvmMember 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 GvmMember class, build a method named CheckJoiningDate() 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 () " a. Write a complete Java program that prints digits of a given number separately. [2 mark] For example, if the given input 329 , the output would be: 329 b. You must Show the details of Tracing the code above that you followed to get the answer. [1 marks] 2. Wrapper Class: Write a complete Java program as follows: a. Create two boolean variables ( a and b ) and give them values. [1 mark] b. Compare the two variables created above using compare() method that takes two boolean values in the parameter which are to be compared. [1 mark] c. What are possible outputs emerged from the compare() method above? Explain all the cases [1 mark]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
