DUE: Friday, February 6 before 11:00pm
This programming assignment is designed in part for us to determine how well you are able to program. Thus, every part of the program should be your own original work, and should not be substantially similar to other students' code, as well code from books, previous solutions, the web, etc. Like other skills (e.g., surgery), the only way to really learn programming is to do it yourself. Some collaboration is O.K., including discussing the general solution method, and some debugging assistance after a student has tried hard to solve the bug him/herself. We DO encourage you to work with others nearby, so if you get stuck, you can get help. But, you should not show your code to another student in order to help that student. For this assignment, copying code from another source (e.g., copy-and-paste, reading off of another's monitor, etc.) is not considered appropriate collaboration and will have severe consequences.
Turn in online to the appropriate folder for your lab section (e.g., as3_22 for students enrolled in lab section 22). Your assignment may not get graded if it gets turned into the wrong section.
Remember to add your name, login, SID (last 4 digits), lecture and lab section numbers, and email address, to the header of your program
You must turn in programming assignments as C++ source files (eg., as3.cpp, as3.cc, or as3.c).
Write a program that calculates how much interest you will end up paying on a credit card balance by the time you pay it off.
Use a function that takes as parameters the initial balance, monthly interest rate, and monthly payment amount. Inside the function, for each month, you should calculate the interest and add it to the current balance and then subtract the monthly payment. When the current balance reaches zero, your function should return the total interest paid.
Your program should get the initial balance, monthly interest rate, and monthly payment amount from the user and then pass those values into the function.
It is possible that the amount of interest owed the first month exceeds the monthly payment. Your program should check for this and output an appropriate message.
The program should allow the user to recalculate as many times as they want using a different monthly payment amount each time. You should not have the user reenter the initial balance and interest rate each time.
The following is a sample output to help you design your program. User input is bold.
Sample:
     Enter your initial balance: