Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the missing code in the following classes class Hero private int pos: /

ID: 3865406 • Letter: C

Question


Complete the missing code in the following classes class Hero private int pos: /*4.1 write the constructor*/ ________ _______ () { pos = 11: } class Fish private double wight: /*4.2 write setter for pos*/ _______ _______ setwight (________ w) { weight = w: } class Pen /*4.3 write 2 perperties of Pen: - color: could be "red", "green", "pink" .. etc ink: amount of left ink in percent, link 88, 10, 99, .. etc private _______ ______: private ______ length: class Account private double Balance: /*write deposite method*/ public void Deposite(_______ amount) { Balance = ______: }

Explanation / Answer

public class Hero
{
private int pos;
// Constructor
public Hero()
{
pos=11;
}
}



-------------------------------------------
public Fish
{
private double wight;
//Setter Method for Fish Class
public void setweight(double w)
{
wight=w;
}
}

--------------------------------------------

public class Pen
{
//Properties of Pen class
private String color;
private int ink;
}
---------------------------------------------
public class Account
{
private double balance;
//Deposit Method
public void deposit(double amount)
{
balance=balance+amount;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote