夜色,ring me 8515658/7159869

/*
*/

#include <iostream.h>
#include<iomanip.h>

void main(void) {
double initial_amount, interest_rate, monthly_payment, amount, final_payment;
int i, month;
const double initial amount=1000, interest rate= 12%, monthly payment=80;

cout << setiosflags (ios::fixed | ios::showpoint)<<setprecision(2);

for (;;) {
cout << "Please enter amount and monthly_payment (0 0 to stop): ";
cin >> initial_amount >> payment;

if (initial_amount == 0 && amount == 0) {
break;
}

if (initial_amount <= 0) {
cout << "** Invalid inputs ignored **" << endl;

} else {

// output header
cout << endl << " Rate Months Total Paid " << endl;

// for each posible interest rate
for (i = 0; i < rows; i++) {

interestment += investment * (interest_rate/100.0);

// produce a row of the table
cout << setw(8) << setprecision(1) << rate;

// compute and output months and the total payment
amount = initial_amount; totalPayments = 0; months = 0;

for (;;) {
// add another month's interest
interest *= 1 + (rate / (12 * 100));

months++;

if (debt < payment) {
// we've come to the last payment
totalPayments += amount;
cout << setw(8) << months << setw(12) << setprecision(2) << totalPayments;
break;
}
// make a regular payment
totalPayments += payment; debt -= payment;

if (debt >= initialDebt) { // we're going nowhere (the debt is growing)
cout << setw(8) << "**" << setw(12) << "****.**";
break;
}

rate = initialRate + (i * rateIncrement);



cout<<setw(8)<<"initial_amount"<<setw(8)<<"Interest_rate"
<<setw(8)<<"monthly_payment"<<setw(8)<<"final_payment"<<endl;
cout<<setiosflags(ios::fixed);<<setprecision(2);

for(i=0;i<=60;i++) {

cout<<setw(8)<<initial_amount<<setw(8)<<interest_rate<<setw(8)
<<monthly_payment<<setw(8)<<final_payment<<endl;
}
year=o;
while(investment<target){
interestment += investment * (interest_rate/100.0);
years++;


}
 
又找人帮你弄作业
到了考试看你咋办。。
 
....你丫也不能是个作业就找我啊
 
#include <iostream.h>
#include<iomanip.h>
#include <conio.h>


void main(void) {
double initial_amount, totalPayments, interest, final_payment, monthlyPayment;
int i, months;
const int rows = 61;
const double interest_rate=12;
monthlyPayment=80;



cout << setiosflags (ios::fixed | ios::showpoint)<<setprecision(2);

for (;;) {

if (initial_amount == 0) {
break;
}

if (initial_amount <= 0) {
cout << "** Invalid inputs ignored **" << endl;

} else {

// output header
cout << endl << " Rate Months Total Paid " << endl;


// for each posible interest rate
for (i = 0; i < rows; i++) {

// produce a row of the table
cout<<setw(8)<<initial_amount<<setw(8)<<interest_rate<<setw(8)
<<monthlyPayment<<setw(8)<<final_payment<<endl;

cout<<"final_payment worth"<<final_payment<<endl;
cout << endl;
}
}

}
 
#include <iostream.h>
#include<iomanip.h>



void main() {
double initial_amount, Payment, annual_interest_rate, final_payment, monthlyPayment, total_interest;
int i, months;
const int rows = 60;





cout << setiosflags (ios::fixed | ios::showpoint)<<setprecision(2);
for (i = 0; i < rows; i++) {

if (initial_amount == 0) {
break;
}

if (initial_amount <= 0) {
cout << "** Invalid inputs ignored **" << endl;

}
else {
//read in initial amount
cout<<"Enter initial_amount<in $>: ";
cin>>initial_amount;

// for each posible interest rate

cout<<"Enter annual_interest_rate <in %>: ";
cin>>annual_interest_rate;


// output header
cout << endl << "MonthlyPayment" << endl;

final_payment=initial_amount + annual_interest_rate - monthlyPayment;
total_interest+=annual_interest_rate++;

cout<<setiosflags(ios::showpoint|ios::fixed)setprecision(2)
<<"At that point the final_payment will be reached"<<final_payment
<<"$."<<endl
<<"At that point the total_interest will be worth$"<<total_interest<<endl;


}
}

}
 
后退
顶部