Question
Q1) Make a 2D array of int to contain the following collections of numbers 1,4,1 1,0 null and 2,2 Q2) change the null to refer
Q1) Make a 2D array of int to contain the following collections of numbers
1,4,1 1,0 null and 2,2
Q2) change the null to refer to this new collection => 1,2,1
Q3) Make a class called Account that contains the following instance variables
money of type double. Make a constructor to set the money and a getter and setter.
Q4) Make a method called deposit that takes a parameter of type double called amount. It increases the money by the amount.
Q5) Make a method called withdraw that returns a boolean and hads one parameter called amount of type double. If you have enough money then update money and return true, otherwise return false.
Q6) Make a class called Person. It has an instance variable called name of type String and another called account of type Account. Make a getter and setter for the account and name.
Q7) Make an equals method. Two Persons are the same if they have the same amount of money in the Accounts.
Q8) people is an array of Person, assume it is filled up. Print out the names of all people who have move than 1000 in their accounts.
Q9) Make a recursive method called isAscending that returns a boolean and has one parameter of type ArrayList of Integer called nos. It should return true if the numbers in nos are is ascending order and false if not.
Q10) Write a program that reads in an int from the user. If the int is not between 0 and 10, make an Exception happen with the message "invalid range". Catch InputMismatchException also, and print out "only integers".
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