MITS4002 Activity 03: Calculating Future Investment Value
VerifiedAdded on 2025/04/28
|4
|395
|423
AI Summary
Desklib provides past papers and solved assignments for students. This is a solved assignment for calculating future investment value.

MITS4002 Activity 03
MITS4002
OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
Activity 03
Project: Calculating Future Investment Value
Student ID:
Student full name:
Total Points (20 pts):
Copyright © 2015-2019 VIT, All Rights Reserved. Page 1
MITS4002
OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
Activity 03
Project: Calculating Future Investment Value
Student ID:
Student full name:
Total Points (20 pts):
Copyright © 2015-2019 VIT, All Rights Reserved. Page 1
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

MITS4002 Activity 03
Contents
Analysis......................................................................................................................................3
Design........................................................................................................................................3
Code...........................................................................................................................................3
Output Screenshot:.....................................................................................................................4
Testing:.......................................................................................................................................4
Copyright © 2015-2019 VIT, All Rights Reserved. Page 2
Contents
Analysis......................................................................................................................................3
Design........................................................................................................................................3
Code...........................................................................................................................................3
Output Screenshot:.....................................................................................................................4
Testing:.......................................................................................................................................4
Copyright © 2015-2019 VIT, All Rights Reserved. Page 2

MITS4002 Activity 03
Analysis
In this program, future investment value will be calculated using the formula which is being
provided. For the program, input will take in the form of double data types and pow function
is being used which is in java.util.Math library. The value which is being taken from the user
is the amount of investment, monthly interest rate and a number of years as a double data
type. The output which is being displayed will be the future investment value which will be
provided to the customer after investing money for number years at after a monthly interest
rate.
Design
The following criteria were designed before coding of a program:
The flow of execution of the program is top to down.
Data types are being defined for every variable which are being used
Double data types will be used for every variable to maintain the compatibility of the
program.
Scanner class will be used for taking the input of variable which is being asked by the user.
Power function will be used for calculating the power of monthly interest rate and the number
of years.
Future investment value is being calculated after performing the following operations
according to the formula which is being provided.
Code
import java.util.Scanner;
import java.lang.Math;
public class Main
{
public static void main(String[] args) {
System.out.println("Enter Investment Amount: ");
Scanner sc = new Scanner(System.in);
double amount_of_investment = sc.nextDouble();
Copyright © 2015-2019 VIT, All Rights Reserved. Page 3
Analysis
In this program, future investment value will be calculated using the formula which is being
provided. For the program, input will take in the form of double data types and pow function
is being used which is in java.util.Math library. The value which is being taken from the user
is the amount of investment, monthly interest rate and a number of years as a double data
type. The output which is being displayed will be the future investment value which will be
provided to the customer after investing money for number years at after a monthly interest
rate.
Design
The following criteria were designed before coding of a program:
The flow of execution of the program is top to down.
Data types are being defined for every variable which are being used
Double data types will be used for every variable to maintain the compatibility of the
program.
Scanner class will be used for taking the input of variable which is being asked by the user.
Power function will be used for calculating the power of monthly interest rate and the number
of years.
Future investment value is being calculated after performing the following operations
according to the formula which is being provided.
Code
import java.util.Scanner;
import java.lang.Math;
public class Main
{
public static void main(String[] args) {
System.out.println("Enter Investment Amount: ");
Scanner sc = new Scanner(System.in);
double amount_of_investment = sc.nextDouble();
Copyright © 2015-2019 VIT, All Rights Reserved. Page 3
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

MITS4002 Activity 03
System.out.println("Enter annual interest rate:");
double interest_rate = sc.nextDouble();
System.out.println("Number of years: ");
double number_of_years = sc.nextDouble();
double future_value_of_investment;
number_of_years = number_of_years *12;
interest_rate = (1+ interest_rate/100);
interest_rate = Math.pow(interest_rate, number_of_years);
future_value_of_investment = amount_of_investment *
interest_rate;
System.out.println("Accumulated values is "+
future_value_of_investment);
}
}
Output Screenshot:
Figure 1 output screenshot
Testing:
Program will be exited if any wrong value is being inserted by showing wrong input.
Other criteria and examples were also calculated according to the formula which is
being used in this program.
Copyright © 2015-2019 VIT, All Rights Reserved. Page 4
System.out.println("Enter annual interest rate:");
double interest_rate = sc.nextDouble();
System.out.println("Number of years: ");
double number_of_years = sc.nextDouble();
double future_value_of_investment;
number_of_years = number_of_years *12;
interest_rate = (1+ interest_rate/100);
interest_rate = Math.pow(interest_rate, number_of_years);
future_value_of_investment = amount_of_investment *
interest_rate;
System.out.println("Accumulated values is "+
future_value_of_investment);
}
}
Output Screenshot:
Figure 1 output screenshot
Testing:
Program will be exited if any wrong value is being inserted by showing wrong input.
Other criteria and examples were also calculated according to the formula which is
being used in this program.
Copyright © 2015-2019 VIT, All Rights Reserved. Page 4
1 out of 4
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.