Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

=+ 5. Do Europeans work more or fewer hours than Americans?

Answered: 1 week ago