A couple of things,
On line 33 and line 34, you are giving the average daily balance and interest. However, you are computing those after you tell the user.
Also, have you tried to compute some examples to see if it matches with the computation on Line 37? It could give you an idea if the computations on the program matches your own that you do on paper or calculator.
For setprecision, you need the #include <iomanip>
Take a look at the setprecision portion in this forum.
The formulas were given with the homework, (averageDailyBalance = (netBalance * d1 – payment * d2) / d1). So, I am just attempting to use it, along with (interest = averageDailyBalance * interest) that was given.
On line 37, based on the formula, i recommend changing from averageDailyBalance = (netBalance * d1 - payment * d2 / d1);
to averageDailyBalance = (((netBalance * d1) - (payment * d2)) / d1);
this is due to the order of math operations.
Thank-you so much for your help. I completed the assignment. It turns out the problem was with the formula, although it was provided with the homework - so I didn't question it! Just goes to show, I should double-check everything regardless!