# Question JAVA thanks AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 4 Complete the following methods in the Person class //returns true if this person is a student and false otherwise public boolean isStudent () return false; } //returns the age of the Person public int getAge() return 0; } //returns 50 if this person is a student between the age of 10 and 20 (inclusive) public int computeDiscount Percent() return 0; } AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 6 Design the CartesianPoint class with instance variables to store coordinates of a two dimensional point (x,y) on the Cartesian plane. The coordinates may be given as floating point values. Write a constructor which takes as input the x and y coordinates Write a default constructor which initialises the point coordinates to zero Create the method double distance From(Cartesian Point q) returns the Euclidean distance between this point and input point q using the following equation (x2 - x)2 + (y2 - y.) You will need to use methods contained within the Math library. Write a method to return true if this point lies on the x-axis and false otherwise Write a method to return true if this point lies on the y-axis and false otherwise AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 7 Design the BankAccount class with instance variables for the customer's name and the current balance of their bank account. Create a constructor which takes as input the customer's name and initialises their bank account balance to 0.0. Write the following methods • void withdraw(int amount), decreases the input amount from the customer's balance, if there is enough money in the account void deposit(int amount) increases the customer's bank account balance. If the input amount is a negative number then the balance does not change • void borrow(int amount) decreases the customer's bank account according to the amount borrowed (including 10% interest), even if the customer does not have enough money. E.g. if amount=100 then the total withdrawn from the account is 100+100*0.10 = 110. Create a CashPoint class with a main method and use the Scanner class to develop an interactive interface to demonstrate all functionality of the BankAccount class and output the balance after each transaction. For this exercise, you do not need to consider incorrect non-numerical inputs.

MR0E08 The Asker · Computer Science

JAVA thanks

Transcribed Image Text: AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 4 Complete the following methods in the Person class //returns true if this person is a student and false otherwise public boolean isStudent () return false; } //returns the age of the Person public int getAge() return 0; } //returns 50 if this person is a student between the age of 10 and 20 (inclusive) public int computeDiscount Percent() return 0; } AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 6 Design the CartesianPoint class with instance variables to store coordinates of a two dimensional point (x,y) on the Cartesian plane. The coordinates may be given as floating point values. Write a constructor which takes as input the x and y coordinates Write a default constructor which initialises the point coordinates to zero Create the method double distance From(Cartesian Point q) returns the Euclidean distance between this point and input point q using the following equation (x2 - x)2 + (y2 - y.) You will need to use methods contained within the Math library. Write a method to return true if this point lies on the x-axis and false otherwise Write a method to return true if this point lies on the y-axis and false otherwise AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 7 Design the BankAccount class with instance variables for the customer's name and the current balance of their bank account. Create a constructor which takes as input the customer's name and initialises their bank account balance to 0.0. Write the following methods • void withdraw(int amount), decreases the input amount from the customer's balance, if there is enough money in the account void deposit(int amount) increases the customer's bank account balance. If the input amount is a negative number then the balance does not change • void borrow(int amount) decreases the customer's bank account according to the amount borrowed (including 10% interest), even if the customer does not have enough money. E.g. if amount=100 then the total withdrawn from the account is 100+100*0.10 = 110. Create a CashPoint class with a main method and use the Scanner class to develop an interactive interface to demonstrate all functionality of the BankAccount class and output the balance after each transaction. For this exercise, you do not need to consider incorrect non-numerical inputs.
More
Transcribed Image Text: AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 4 Complete the following methods in the Person class //returns true if this person is a student and false otherwise public boolean isStudent () return false; } //returns the age of the Person public int getAge() return 0; } //returns 50 if this person is a student between the age of 10 and 20 (inclusive) public int computeDiscount Percent() return 0; } AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 6 Design the CartesianPoint class with instance variables to store coordinates of a two dimensional point (x,y) on the Cartesian plane. The coordinates may be given as floating point values. Write a constructor which takes as input the x and y coordinates Write a default constructor which initialises the point coordinates to zero Create the method double distance From(Cartesian Point q) returns the Euclidean distance between this point and input point q using the following equation (x2 - x)2 + (y2 - y.) You will need to use methods contained within the Math library. Write a method to return true if this point lies on the x-axis and false otherwise Write a method to return true if this point lies on the y-axis and false otherwise AUT COMP503/ENSE502/ENSE602:02 - Exercises Exercise 7 Design the BankAccount class with instance variables for the customer's name and the current balance of their bank account. Create a constructor which takes as input the customer's name and initialises their bank account balance to 0.0. Write the following methods • void withdraw(int amount), decreases the input amount from the customer's balance, if there is enough money in the account void deposit(int amount) increases the customer's bank account balance. If the input amount is a negative number then the balance does not change • void borrow(int amount) decreases the customer's bank account according to the amount borrowed (including 10% interest), even if the customer does not have enough money. E.g. if amount=100 then the total withdrawn from the account is 100+100*0.10 = 110. Create a CashPoint class with a main method and use the Scanner class to develop an interactive interface to demonstrate all functionality of the BankAccount class and output the balance after each transaction. For this exercise, you do not need to consider incorrect non-numerical inputs.