Define two enum, first for Gender and another for Month. Gender shall be enumeration of two values i.e. Male and Female. Month enum shall be defined with January, February, ... up to December as...


Define two enum, first for Gender and another for Month. Gender shall be enumeration of two values i.e. Male and Female. Month enum shall be defined with January, February, ... up to December as values. Month enum shall also store the number of days of each month.


Define a User that shall be composed of id, name, gender and birthMonth attributes. Use above created enums for gender and birthMonth fields. Create a User object and initialize it from user input, gender shall be initialized in constructor and birthMonth shall be initialzed using set methed. After the object is initialized, print all fields' values of user object. Also print the number of days of birthMonth.



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here