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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started