Create a class that will bundle together several static methods for interestcalculations. This class should not have a constructor. Its attributes are• principal—as a static double variable that starts at $10000• rate—as a static double variable that starts at 7%Its methods are• calculateSimpleInterest(time)—a static method that returns theamount calculated with the simple interest formula, rounded to thenearest penny.• computeCompoundInterest(time)—a static method that returns theamount calculated with the compound interest formula, rounded to thenearest penny.• changePrincipalTo(newPrincipal)—a static method that changes thevalue of the principal.• changeRateTo(newRate)—a static method that changes the value of therate.• roundToNearestPenny(amount)—a private static method that returnsthe given amount rounded to the nearest penny. For example, if theamount is 1023.659, the method will return 1023.66.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here