getApr() should prompt for and input a percentage as, for example, 3.5 for 3.5%. It should return the percentage as a double , as, for
getApr() should prompt for and input a percentage as, for example, 3.5 for 3.5%. It should return the percentage as a double, as, for example, .035 for input of 3.5. The method should print an error message and exit the program if the percentage is negative or 0.
getInvestment() should prompt for and input an investment amount as a double and return it. If the amount is negative or 0, the method should print an error message and exit the program.
printAsMoney(double value) should format the argument as currency using a DecimalFormat and print it, staying on the same line.
compound(double value, double apr) should return a double, (1+apr) * value
What are some examples of how these methods would be used in java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started