Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the answers to these in Java format 3. (21 points) Write a method that calculates and returns the value of an investment after

I need the answers to these in Java format image text in transcribed
3. (21 points) Write a method that calculates and returns the value of an investment after a number of years, assuming that interest is compounded only at the end of each year. Your method will need the following parameters: The initial amount of money invested The interest rate The number of years you will be holding the investment You can use the formula value = investment * (1 + rate)years . You must include a Javadoc comment Name CSCI161-(01,02,03 Homework 03- Page 2 4. (19 points) Write a main method that would go in the same class as the previous method. It should read an initial investment amount and interest rate from the user. Then it should print a two-column table showing the number of years and final value for each year from 1-20. You do not need to include Javadoc comments. You may assume that the Scanner class has already been imported

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions