MITS4002 Activity 03: Future Investment Value Calculator Project
VerifiedAdded on 2025/04/28
|4
|299
|474
AI Summary
Desklib provides past papers and solved assignments for students. This project demonstrates calculating future investment value using Java.

MITS4002
OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
Activity 03
Project: Calculating Future Investment Value
Student ID:
Student full name:
Total Points (20 pts):
OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
Activity 03
Project: Calculating Future Investment Value
Student ID:
Student full name:
Total Points (20 pts):
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

MITS4002 Activity 03
Contents
Analysis...........................................................................................................................................
Design..............................................................................................................................................
Coding..............................................................................................................................................
Output screenshot............................................................................................................................
Testing.............................................................................................................................................
Copyright © 2015-2019 VIT, All Rights Reserved. Page 2
Contents
Analysis...........................................................................................................................................
Design..............................................................................................................................................
Coding..............................................................................................................................................
Output screenshot............................................................................................................................
Testing.............................................................................................................................................
Copyright © 2015-2019 VIT, All Rights Reserved. Page 2

MITS4002 Activity 03
Analysis:
In the given problem, we need to design a program which would take amount of investment, rate
of annual interest & no. of years as input from the user and calculates the future investment value
based on the formula provided. The output of the program will be the calculated future
investment value.
Design:
1. All the variables were declared with their datatypes.
2. Main class was declared and inputs were taken from the user with scanner class object.
3. The future investment value was calculated based on the inputs from the user with the
formula given to us in the problem statement.
4. The program printed the calculated “fi” value.
5. The program was made such that it could handle exceptions.
Coding:
import java.util.Scanner;
import java.util.InputMismatchException;
public class fiValue {
public static void main (String[] args) {
try {
double fi=0.0;
Scanner scanner= new Scanner (System.in);
System.out.println("Amount of investment required: ");
double amt= scanner.nextDouble();
System.out.println("Rate of interest required (in %): ");
double interest= scanner.nextDouble();
System.out.println("Number of years required: ");
double years=scanner.nextDouble();
fi= amt* Math.pow((1+interest/100),years);
System.out.println("Accumulated value is: " + fi);
}
catch (InputMismatchException e) {
System.out.println("You must enter valid numericals");
main(null);
}
catch (Exception e) {
System.out.println(e);
main(null);
}
Copyright © 2015-2019 VIT, All Rights Reserved. Page 3
Analysis:
In the given problem, we need to design a program which would take amount of investment, rate
of annual interest & no. of years as input from the user and calculates the future investment value
based on the formula provided. The output of the program will be the calculated future
investment value.
Design:
1. All the variables were declared with their datatypes.
2. Main class was declared and inputs were taken from the user with scanner class object.
3. The future investment value was calculated based on the inputs from the user with the
formula given to us in the problem statement.
4. The program printed the calculated “fi” value.
5. The program was made such that it could handle exceptions.
Coding:
import java.util.Scanner;
import java.util.InputMismatchException;
public class fiValue {
public static void main (String[] args) {
try {
double fi=0.0;
Scanner scanner= new Scanner (System.in);
System.out.println("Amount of investment required: ");
double amt= scanner.nextDouble();
System.out.println("Rate of interest required (in %): ");
double interest= scanner.nextDouble();
System.out.println("Number of years required: ");
double years=scanner.nextDouble();
fi= amt* Math.pow((1+interest/100),years);
System.out.println("Accumulated value is: " + fi);
}
catch (InputMismatchException e) {
System.out.println("You must enter valid numericals");
main(null);
}
catch (Exception e) {
System.out.println(e);
main(null);
}
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
}
}
Output screenshot:
Figure 1: Future investment calculator
Testing:
1. The sample values were entered as input and the program returned the correct value as
output.
2. Another set of sample values were entered and the correct answer was shown.
Copyright © 2015-2019 VIT, All Rights Reserved. Page 4
}
}
Output screenshot:
Figure 1: Future investment calculator
Testing:
1. The sample values were entered as input and the program returned the correct value as
output.
2. Another set of sample values were entered and the correct answer was shown.
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.