Question: This is using java (INTELLI J) and Gradle. I will appreciate if you can help me to solve those problems. I am starting learning programming+

 This is using java (INTELLI J) and Gradle. I will appreciate

This is using java (INTELLI J) and Gradle. I will appreciate if you can help me to solve those problems. I am starting learning programming+ java, so it is kinda difficult for me to solve and get the correct results of this.

****PLEASE, If you make a comment before making each part, I will appreciate it. (EX. //methods for ... ). It will help me to understand and follow what you are writing and doing.

THANK YOU!

Question 1 Create a class called InvalidParamterException that extends the java class named Exception. Add a single constructor that accepts a String argument. The constructor simply calls the parent class (hint: remember what the keyword super does) using the String passed to constructor. Question 2 Create an interface called Investment with the following methods: name: returnValue, arguments: none, returns: double, access: public, throws: InvalidParameterExcep- tion name: returnProfit, arguments: none, returns: double , access: public, throws: InvalidParameterExcep- tion Question 3 a) Create a class called Cash Money that implements Investment with the following fields: name: amount, type: double, access: private name: monthlyInterest, type: double, access: private name: investment Months, type: int, access: private b) Create a default and a parameterized constructor for the CashMney class. The parameterized constructor should accept all 3 fields in the class. c) Populate the approriate methods from the Investment interface. Use the interest rate and number of months of investment investment Months) to calculate the value and profit of the investment. Don't overthink this. Use the following formula to calulate the value of the investment: value = amount x (1 + rate number of periods profit = value - amount d) In your return Value method, determine if either the interest rate or length of investment is negative. If so, throw a custom InvalidParameterException with the message below. Note that a try/catch is not required in this method. CashMoney field values are not all valid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!