Implement a class named Rectangle to represent a rectangle. The class contains:
Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 35.7. (you can read them from the user or just put them directly in your code) Display the width, height, area, and perimeter of each rectangle in this order (in the main. Just create 2 rectangles instances and call the 4 functions on each of the rectangles. And print their results)
Output will look like this :
Implement a class named Stock to represent a company’s stock that contains:
Write a test program that creates a Stock object with the stock symbol INTC, the name Intel Corporation, the previous closing price of 20.5, and the new current price of 20.35, and display all the information of the newly created Stock along with the price-change percentage.
Implement a class named Account that contains:
(Hint: The method getMonthlyInterest() is to return the monthly interest amount, not the interest rate. Use this formula to calculate the monthly interest: balance *monthlyInterestRate. monthlyInterestRate is annualInterestRate/ 12.
Note that annualInterestRate is a percent (like 4.5%). You need to divide it by 100.)
Write a test program that creates an Account object with an account id of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Print the information of the newly created object.
Now, use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and then print the id, balance, monthly interest rate, and monthly interest after doing the withdraw and deposit.
After doing the withdraw and deposit .