Make a program Using if-ealse Statement

Hi.Can you please help me make a program out of the problem.It's our homework but I'm still new on it and I can't make a program.It's will be pass on the next 12hours.I will deeply appreciate if anyone answer it.
Problem:
Write a program that calculates the balance of savings account at the end of the period of time. It should ask the user for the annual interest rate, the starting balance and the number of months that have passed since the account was established. A loop should then iterate once fir every month, performing the ff.:
A. Ask the user for the amount deposited into the account during the month . (Do not accept negative numbers) this amount should be added to the balance.
B. Ask the user for the amount withdrawn from the account during the month(do not accept negative numbers). This amount should be subtracted from the balance.
C. Calculate the monthly interest . The monthly interest rate is the annual interest rate divided by twelve. Multiply the monthly interest rate by the balance, and add the result to the balance
After the last iteration, the program should display the ending balance, the total amount if deposits, the total amount of withdrawals, and the total interest earned.
Note: if a negative balance is calculated at any point, a message should be displayed indicating the account has been closed and the loop should terminate.
Last edited on
It should ask the user for

http://www.cplusplus.com/doc/tutorial/basic_io/

A loop should then iterate

http://www.cplusplus.com/doc/tutorial/control/

get that bit working first.
Can you make a program?
#include<stdio.h>
int main()
{


}
Need help. :(
Even this:
#include<stdio.h>

is 'incorrect'.

Read those links. I am not going to do it all for you, but help is there for specific questions.
Last edited on
#include <stdio.h> is only in c. In c++ we use #include <iostream> for the input and output library.
That's the first error.
First you must ask the user to enter the size. Next ask the user the value using loop if the input are negative tell the user to enter the correct input. I prefer the for loop for the value. Don't forget to output the input. Next same from step before but insert the the function to substract. Final step insert the monthly interest rate function then output the screen. That's what i can tell. If there's some question or error ask me.
Krisna

I see alot of people coming here for help on their homework 12 - 24 hours before deadline, and just throw the assignment up on this forum and expect a fully functioning program that is meeting the assignment's conditions to appear, and why wait till last minute? :)
Topic archived. No new replies allowed.