Answer to Question #173922 in C++ for Vimal D

Question #173922

An automobile financier claims to be lending money at simple interest where the Principle and Year are the input and Rate of Interest is 12%. Write a C++ program to calculate it using default arguments.


1
Expert's answer
2021-03-23T01:44:50-0400
#include <iostream>
using namespace std;
int main (){
	double P;//Principle
	int years;
	cout<<"Principle: ";
	cin>>P;
	cout<<"Year(s): ";
	cin>>years;
	//Calculate simple interest
	double si=P*0.12*years;
	cout<<endl<<"Simple interest: "<<si<<endl<<endl;
	//delay
	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS