1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivanzaharov [21]
3 years ago
14

Python Code that predicts the amount of money you will have in your IRA when you retire. Inputs are: 1. Number of years until yo

u retire, it must be a whole number (integer) in the range 1 to 70. Any number outside of this range is to be rejected and the user will be required to enter the value again, this repeat must be done until a valid number is input. 2. Expected interest rate as a percent (this the average expected earnings per year until retirement is reached). The number must be 0 or greater, any other value will be rejected and as above, the user must be polled until a valid number is input. If the number is greater than 10%, the user must be asked if he/she really expects to earn this much, if the user replies in the affirmative, the number is to be used, otherwise the user will be asked to input the value again and the above checks will be made. 3. The initial amount in the IRA. This is a decimal number and may be any non-negative number. If a negative number is entered, the value is to be rejected and the user will be required to enter an acceptable value. Again, loop until a valid value is input. 4. The amount expected to be added to the IRA each year. This is a decimal number in the range of 0 to $2,500. The program must loop asking for this value until a valid value is entered. After the data is input and validated, the program is to loop printing out the value of the IRA every 5 years and the value at the end of the time entered as input #1. The value is to be computed in a loop where the value each year is determined by: value = value + (value)*rate + yearlyInput
Computers and Technology
1 answer:
zaharov [31]3 years ago
3 0

Answer:

yearsUntilRetire =0

expectedInterest =-1.00

initialAmount =-1.0

expectedAmountToAdd = -1.00

while yearsUntilRetire < 1 or yearsUntilRetire > 70:

yearsUntilRetire = int(input("Number of year until you retire between 1 to 70: "))

while expectedInterest <0 :

expectedInterest = float(input("enter the expected rate : "))

if expectedInterest >= 10:

doubleCheckRate = input("do you really expect {} interest rate: ".format(expectedInterest)).lower()

if doubleCheckRate == "false":

expectedInterest =-1.00

while initialAmount < 0:

initialAmount = float(input("Enter positive initial amount for IRA: "))

while expectedAmountToAdd < 0 or expectedAmountToAdd > 2500:

expectedAmountToAdd = float(input("Enter positive IRA amount to be added each year between 0 to $2500: "))

finalContribution =initialAmount

for i in range(yearsUntilRetire):

finalContribution = finalContribution + finalContribution * (expectedInterest/100.00) + expectedAmountToAdd

if (i+1) % 5 == 0:

print("Contribution after year {} is ${:,.2f}.".format(i+1,finalContribution))

 

print("Final Contribution is ${:,.2f}.".format(finalContribution))

Explanation:

  • Use a loop to get the valid input from the user for years until retire between 1 to 70 .
  • Get the valid input for expected rate .
  • Check if expected rate is greater than or equal to 10 then ask the user again if one expect such high rate .
  • Use a loop to get valid IRA initial Contribution .
  • Use a loop to get expected Amount to add regularly in IRA .
  • Iterate over numbers of year and print the data after 5 years .
You might be interested in
Which frequency will 802.11n work on if on a single-link network?
Allushta [10]

802.11n can function in "mixed mode" on the 2.4 GHz frequency, with a theoretical maximum speed of 300 Mbps, or on the 5 GHz frequency.

<h3>What do you mean by frequency?</h3>

In the case of electrical current, frequency is the number of times a sine wave repeats or completes, a positive-to-negative cycle.

802.11n can operate in "mixed mode" on the 2.4 GHz frequency, which will support just 802.11b or 802.11g-capable systems but will slow the entire network down to the maximum speed of the earliest standard connected, at a theoretical maximum speed of 300 Mbps.

Learn more about the single-link network:

brainly.com/question/4272298

#SPJ1

8 0
1 year ago
Thsi is for gacha girl5467
djyliett [7]

Answer:

lol

Explanation:

3 0
2 years ago
Read 2 more answers
Can run mobile-style apps in the area known as the start screen, while running traditional software in the more familiar desktop
Travka [436]
The correct answer: Yes, mobile-style apps can run in a personal computer's desktop.

That is possible by means of a desktop application called emulatator. An emulator like Bluestacks allows a personal computer to run mobile-style apps by acting as a virtual drive in the personal computer's harddisk. 

Emulation is successful if the system requirements of the mobile-application is met by the personal computer's system attributes such as Random Access Memory abundance, Random Access Memory speed, Processing speed (in some cases core abundance e.g. core 2) etc. 

Some mobile-applications do not work in the personal computer's desktop, however, if this application requires platform specific functions such as mobile device's network provider etc.
4 0
3 years ago
In the circuit seen here, the resistor has a resistance of 3 ohms. If no change in the battery size occurs, what will happen to
Rufina [12.5K]

It will increase by a factor of 2

6 0
3 years ago
Read 2 more answers
Write a calculator program that will allow only addition, subtraction, multiplication &amp; division. Have the
ozzi

num1 = float(input("Enter the first number: "))

num2 = float(input("Enter the second number: "))

operation = input("Which operation are you performing? (a/s/m/d) ")

if operation == "a":

   print("{} + {} = {}".format(num1, num2, num1+num2))

elif operation == "s":

   print("{} - {} = {}".format(num1, num2, num1-num2))

elif operation == "m":

   print("{} * {} = {}".format(num1, num2, num1*num2))

elif operation == "d":

   print("{} / {} = {}".format(num1, num2, num1/num2))

I hope this helps!

8 0
2 years ago
Other questions:
  • A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the
    12·1 answer
  • How do I change my keyboard's debounce time?
    15·2 answers
  • Plagiarism occurs when writers
    14·2 answers
  • Possible consequences for plagiarism, listed in CAVA's Academic Integrity Policy, may include:
    9·1 answer
  • Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of
    15·1 answer
  • Write a function called printBackwards() that will work with a C string. The function will print any C string backwards. You don
    13·1 answer
  • Name the different views in word​
    5·1 answer
  • ________ are the primary means of authentication for a user's computer and other networks and servers to which the user may have
    10·1 answer
  • What are some catchy names for computer basics that you would put on a childrens poster?
    9·1 answer
  • The software concept ___________and defines a need for the new system.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!