Answer:
investmentAmount = float(input("enter the investment amount: "))
annualInterestRate = float(input("enter the Annual Interest Rate: "))
numYears = int(input("Enter NUmber of Years: "))
monthlyInterestRate = annualInterestRate/12
futureInvestmentValue = investmentAmount * (1 + monthlyInterestRate)*(numYears*12)
print("The Future Investment Value is: ")
print(futureInvestmentValue)
Explanation:
Using python programming language as required, we use the input function to prompt user for inputs for each of the variables.
There is a conversion from the variable annualInterestRate to monthlyInterestRate before the formula for the futureInvestmentValue is applied
Answer:
The answer to this question is option "d".
Explanation:
In the given question option d is correct because variable-length argument is a new feature in J2SE 5.0 which stands for java 2 standard edition and 5.0 is the version name. It is the variable-length argument lists. A coder can create functions that uses a function to receive several parameter that is not specified. An argument type followed by an ellipsis(...) in the parameter list of a method means that a fixed number of arguments of that particular type is obtained by the method. and other options are not correct that can be given as:
- In option a, we do not need to use the string the variable-length argument list. That's why it is wrong.
- The option b and c are all wrong because in the last parameter the variable-length argument list is used.
That's why the answer to this question is the option "d".
I have annotated the errors in the picture.
<em />
<em>Hope this helps :)</em>
Answer:
B) To package a repeated task as a function even though the task does not yield a value
Explanation:
The purpose of a function that returns "void" is to package a repeated task as a function even though the task does not yield a value. Since the function does not return any value, it control returns to the caller.