/** Copyright (c) 2012, School of Computer Science, Yantai University * All Rights Reserved. * Author: Yang Chen * Completion Date: July 15, October 19, 2012 * version: V1.0 ** input Description: none * Problem description: Calculating the regular repayment quota * program output: Output payment * problem analysis: set multiple variables, replace the fraction with the variable, and use the floating point type for calculation. * Algorithm Design: */# include <iostream> # include <cmath> using namespace STD; int main () {double principal; double rate; double payperyear; double numyears; double denom; double payment; double number; Double E; Double B; cout <"input principal:"; CIN> principal; cout <"input interest rate:"; CIN> rate; cout <"Enter the number of times the loan is repaid each year:"; CIN> payperyear; cout <"loan duration:"; CIN> numyears; number = Rate * Principal/payperyear; B = (rate * payperyear) + 1; E =-(P Ayperyear * numyears); denom = 1-Pow (B, E); payment = Number/denom; cout <"payment is" <payment; return 0 ;} observation and experience: the output result is the same as that of the previous operation. My conclusion: The first time I came into contact with the floating point model, I also said that I had encountered the problem of adding a superfluous image. I didn't understand the problem clearly before, but after I understood it, I suddenly became very open !!! Park sorry. I love u!
Result: