Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percent simple interest for one year. Create a separate method to do the calculation and return the result to be displayed.

Modify the program in Exercise 2a so that the main program prompts the user for the amount of money and passes it to the interest-calculating method.

Modify the program in Exercise 2b so that the main program also prompts the user for the interest rate and passes both the amount of money and the interest rate to the interest-calculating method.

To create the logic for the program that calculates the amount of money after investing, you can follow the steps below:

Step 1: Create a method called calculateInterest.
- This method will receive two parameters - the amount of money and the interest rate.
- Inside the method, calculate the interest by multiplying the amount of money by the interest rate and dividing it by 100.
- Finally, return the calculated interest.

Here's an example implementation in Python:

```python
def calculateInterest(amount, interest_rate):
interest = (amount * interest_rate) / 100
return interest
```

Step 2: In the main program, prompt the user for the amount of money and the interest rate.
```python
amount = float(input("Enter the amount of money: "))
interest_rate = float(input("Enter the interest rate: "))
```

Step 3: Pass the amount and interest_rate variables to the calculateInterest() method.
```python
result = calculateInterest(amount, interest_rate)
```

Step 4: Display the result to the user.
```python
print("The amount after one year of investment would be: $" + str(result))
```

Putting it all together, here's the complete code:

```python
def calculateInterest(amount, interest_rate):
interest = (amount * interest_rate) / 100
return interest

amount = float(input("Enter the amount of money: "))
interest_rate = float(input("Enter the interest rate: "))

result = calculateInterest(amount, interest_rate)

print("The amount after one year of investment would be: $" + str(result))
```

This modified program prompts the user for the amount of money and the interest rate, and then passes both values to the `calculateInterest()` method to calculate the result. Finally, it displays the calculated amount to the user.