Answer to Question #172797 in C++ for Sharath kumar

Question #172797


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-19T14:14:19-0400
#include <iostream>
using namespace std;
//The start point of the program
int main (){
	float principle;
	int year;
	//the Principle and Year are the input and Rate of Interest is 12%.
	//get the Principle from the user
	float rateInterest=0.12;
	cout<<"Enter principle: ";
	cin>>principle;
	cout<<"Enter the number of year: ";
	cin>>year;
	//Calculate simple interest
	float simpleInterest=principle*rateInterest*year;
	cout<<"\nSimple interest: "<<simpleInterest<<"\n";
	//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