Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 (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
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