Question: looking for an expert on Object-oriented Programming, please. It's about Programmer-defined Classes **please separate the questions with the question number** Exercise 1: Numbers Class Task
looking for an expert on Object-oriented Programming, please.
It's about Programmer-defined Classes
**please separate the questions with the question number**



Exercise 1: Numbers Class Task 1: Create a class named Numbers that has two private int data members. Provide a no-arg constructor that initializes both data members to 1. (1) Provide get and set methods for each data members. (ii) Write a method named addNumbers that returns the addition of both data members. (iii) Write a method named subtract Numbers that returns the subtraction of data members. Task 2: Write a main class that demonstrates objects of Numbers. Exercise 2: Account Class Task 1: Create Account class according to the UML diagram below: Account - balance : double + Account (initBalance: double) + getBalance (: double + deposit (amt: double void + withdraw (amt: double: void Task 2: Create TestAccount class as follows: Add main method to the TestAccount class Declare an object name acctl of type Account and create an instance of the Account class with an initial balance of RM100.00; Use the deposit method to add RM50.00 to acctl. Use the withdraw method to deduct RM140.00 from acctl. Use the getBalance method to retrieve the new account balance and use System.out.println method to display the balance to the standard output. Compile and run TestAccount class. Exercise 3: Circle Class Task 1: Create Circle class to define circle objects: It has data member of type double to store the circles radius value. It has 4 methods as follows: i. setRadius it accepts one double value and assign it to radius data member. ii. getRadius it returns the value fromradius data member. iii. area - it returns the area of the circle's object (formula: Tr) iv. circumference it returns the circumference length of the cirlce's object (formula: 27) Task 2: Create TestCircle class to demonstrate Cirlce's object: Create 2 objects from Circle class. Assign the radius to 2.3 and 4.8 respectively. Display the area and circumference of both objects
Step by Step Solution
There are 3 Steps involved in it
Sure Lets tackle each exercise stepbystep Exercise 1 Numbers Class Task 1 Step 1 Define the Numbers class with two private integer data members java p... View full answer
Get step-by-step solutions from verified subject matter experts
