14,600,948 members
Rate this:
See more:
Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a file.
Menu will be doing the following:
Enter (1) to calculate your loan monthly payment
Enter (2) to calculate your loan monthly payment & write to a file
Compound Interest Formula
A = P(1 + r/n)^n*t
P = principal amount (the initial amount you borrow or deposit)
r = annual rate of interest (as a decimal)
t = number of years the amount is deposited or borrowed for.
A = amount of money accumulated after n years, including interest
n = number of times the interest is compounded per year
The program will be displaying something like the following:
Borrower’s Name:
Borrower’s Phone:
Loan Amount:
Interest Rate (APR):
Fixed Monthly Payment:
Note – always with the option to display in a file or on the screen.

What I have tried:

I have tried to create a function A to get input and pass it to function B to calculate.
Posted
Updated 12-Aug-19 22:22pm
Rick York 13-Aug-19 0:22am

We are not here to do your homework for you but we help you with you programming questions. So, what is your question?
Stefan_Lang 13-Aug-19 4:01am

"What I have tried:
I have tried to create a function A to get input and pass it to function B to calculate."
Fine. Then show us that function and tell us what problem you have with it. The Q&A section is meant to help people fix existing code, not write code for them!

Rate this:

## Solution 1

We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
zara7 13-Aug-19 7:10am

Thanks for responding, I have a complete code, just encountered an error, and sorry I wasn't specific about my question since it's my first time asking one. I think I have figured out the problem, I will try it again, but if it doesn't work again, then I will be more specific with my question again. Thanks
Patrice T 13-Aug-19 7:14am

See OP comment in S3.
Rate this:

## Solution 2

You are a lucky developer, because you have all the requirements and thus can start coding without guesswork. So, as per requirements:
• Collect inputs.
• Compute values.
• Produce outputs.
Post here specific questions whenever you're stuck.
Hint: you could make your ouptut function(s) accept a `iostream` reference in order to direct the output to the console or to a file, without changing the actual code.
Stefan_Lang 13-Aug-19 4:02am

"You are a lucky developer, because you have all the requirements and thus can start coding without guesswork. "

That made my day :-D He really doesn't know how lucky he is!
zara7 13-Aug-19 7:08am

Sorry I didn't post a specific question. I just encountered an error in my code, but I have figured it out. Thanks
Patrice T 13-Aug-19 7:14am

See OP comment in S3.
Rate this:

## Solution 3

Quote:
I have tried to create a function A to get input and pass it to function B to calculate.

And ? this is supposed to explain your problem ?

You show no attempt to solve the problem yourself, you have no question, your main effort is pasting the requirement, you just want us to do your HomeWork.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
zara7 13-Aug-19 7:05am

I am new here and was not asking you to do my homework for me (or write down the codes). Sorry I wasn't specific enough on the point I had an error in but I think I figured it out, if it still gives me an error, I will ask for help again with more specific question. Thanks to everyone for responding to my question, I appreciate
Patrice T 13-Aug-19 7:13am

Do not hesitate to come back with specific questions.