Question: JAVA: Write some code that first takes in input the value of the bank account, then the value of the interest rate. Print out how

JAVA:
Write some code that first takes in input the value of the bank account, then the value of the interest rate. Print out how much th a
Goal: Learn how to use typecasting.
Assignment: Given two variables n and m and two weights wn and wm, the weighted average between n and m is given by:
n**wn+m**wmwn+wm
Assuming the int variables n , m , wn, wm have been defined and initialized, and that the double variable weightedAverage has been declared,
write a statement that assigns to weightedAverage the weighted average between n and m .
1
2
3
4
Expected output:
Givens
Actual output:
n.equal to *1
Givens
merequal to *2
n-equal to.1,
m-equal to 3,
m.equal to *2
win.equal to 4,
wh-equal to.3.
the-weightedAverage-is 1,5714285714285714
vin-equal to 4.4
the meightedAverage is -1.0ccount will be worth in one, two, and three years, each on a separate line.
JAVA: Write some code that first takes in input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!