For problems 10 - 17, we will be referring to the following Account class definition, public class Account { private int

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

For problems 10 - 17, we will be referring to the following Account class definition, public class Account { private int

Post by answerhappygod »

For Problems 10 17 We Will Be Referring To The Following Account Class Definition Public Class Account Private Int 1
For Problems 10 17 We Will Be Referring To The Following Account Class Definition Public Class Account Private Int 1 (29.33 KiB) Viewed 19 times
11. fill in the blacnk so the if statement prints "same" if sal
and jen have the same balance
if(___________________________________)
system.out.println("same");
12. write a statement to assign a balance of $3000.00 to jen;s
account.
13. write a statement to add $500 to sal's balance, using only
the set and get methods and the technique of compositions
For problems 10 - 17, we will be referring to the following Account class definition, public class Account { private int account Number; private double balance; public Account() { this.account Number = 0; this.balance = 0.0; } public Account(int accountNumber, double balance) { this account Number = account Number; this.balance = balance; } public double getBalance() { return this.balance; } public void setBalance (double balance) { this.balance = balance; } public double getAccount Number() { return this account Number; } public void setAccount Number(int account Number) { this.account Number = account Number; } Also, suppose in a main method somewhere, you have created the following objects: Account sal = new Account (12345, 1500.00); Account jen = new Account(54321, 2000.00); 10. Write a statement to print only sal's account number
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply