Code:
#include<iostream>
#include<iomanip>
#include<stdlib.h>
using namespace std;
// prototype goes here
double calcint(double amount, double rate);
int year;
double rate;
double amount;
int main()
{
// declare variables
year = 12;
// get user input
cout << "Enter loan amount: " << amount << cin << amount << endl;
cout << "Enter loan rate: " << rate << cin << rate << endl;
// call function for calculation
calcint(amount, rate);
cout << "This is your annual intrest rate: " << calcint << endl;
// display results
system("pause");
return 0;
}
double calcint(double amount, double rate)
{
return amount * rate * year;
}
I'm having the toughest time understanding why I cannot use prototypes rightfully.
Someone please help, I've started to understand some, from other helpful programmers but I dont fully comprehend.