Question: Question 1: a) Create a class UnderGrad with 5 variables: age (int), activity (String), name (String). private grade (double), bonus (double). b) Create a mutator

 Question 1: a) Create a class UnderGrad with 5 variables: age

Question 1: a) Create a class UnderGrad with 5 variables: age (int), activity (String), name (String). private grade (double), bonus (double). b) Create a mutator for the variable grade. c) Create a method display to print all the variables. d) Create method Math of the type void that takes X (int) and determine if it is a positive number or not. c) Create a method decreaseBonus that takes amount (double) and decrease the bonus by that amount. (make sure to use a return-type method) 1) Create a default constructor that gives bonus a default value of 270 g) Create an argument constructor that takes age, activity, and name and gives bonus a value of 270 h) Define object UG1 and use constructor in part F 1) Define UG2 and use constructor in part G j) Set the grade for UG1 and UG2 (using scanner) k) decrease the bonus for UG1 by 195 1) Print all the details for both UGI and UG2 using display method in part C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!