Question: Using Java Define a class of Students with the following properties and actions: a string name, an integer age, a Boolean variable indicating whether or
Using Java Define a class of Students with the following properties and actions: a string name, an integer age, a Boolean variable indicating whether or not the student is an IT major, and a character gender. The default value for name is an empty string, for age is 0, for the Boolean variable is false, and for the gender is \u0000. To compute the students age, the year of birth and the current year must be provided. The students name and gender are set to the values provided. To set the Boolean value, the students major must be provided. If it is IT, the Boolean variable is set to true; otherwise, it is set to false. A student can change major. In such situation, the new major must be provided. If it is IT, the Boolean variable is set to true; otherwise, it is set to false.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
