Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment# 1 part 1 : Description of the Problem: Write a program that receives three input values: an input value for a total amount in
Assignment# part :
Description of the Problem: Write a program that receives three input values: an input value for
a total amount in a deposit account as a double value, an annual interest rate, and number of
years. The program then calculates and displays the future investment amount using the following
formula:
fia iia mir
Where:
fia is Future Investment Amount,
iia is Initial Investment Amount,
mir is Monthly Interest Rate ie Annual Interest Rate divided by
y Number of Years.
For example, if you enter an Initial Investment Amount of as deposit amount and, an annual
interest rate of and number of years the future investment amount fia in the end of two
years will be:
Execute your program using the following sample input values and provide your program output:
Enter investment amount iia:
Enter annual interest rate in percentage:
Enter number of years:
Future Investment Value is calculated is: $
Hint:
use the Math pow method to compute a raised to the power
Followup Program Assignment# part
Continue your code above to the following steps:
Your program should convert the final fia value to an integer number eg
above to an integer number, identified as fiai eg fiai
Write code to separate digits of fiai value into its individual digits and print the digits
one on each line. For example, in the above case, digit appears on one line, followed
by digit on the following line, and so on and finally digit on the last line.
ProblemSolving Tips for part:
The FIAI final value consists of one integer, so you are using an int variable to represent it
You will use a series of statements to "break down" the number into its individual digits, using
integer arithmetic with remainder and division calculations.
For example the fiai divided by gets the first digit. Why does this operation work?
Dividing an integer by an integer yields an integer result. Because the number input is five digits
long, dividing it by gives the leftmost digit eg digit
For example, evaluates to because divides into four times. The
remainder is truncated in integer arithmetic.
Change the number to a fourdigit number, using the remainder operator to obtain the remainder
after the number is divided by in this case, the rightmost four digits.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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