I wrote the following program, but my compiler (dev-cpp) says thereis an error w
ID: 3613004 • Letter: I
Question
I wrote the following program, but my compiler (dev-cpp) says thereis an error with the float command. I am unsure how to solveit.// Interest Calc.cpp
// To calculate amount gained or lost in interest
#include <iostream>
using namespace std;
int main()
{float Initial_Amount, Interest, Compoundments, Time,Total_Amount, Net_Change, Net_Change_Year, Net_Change_Month,Net_Change_Day;
cout << "Enter the Initial Amount: ";
cin >> Initial_Amount;
cout << "Enter Intrest (%): ";
cin >> Interest;
cout << "Number of Compoundments (Years): ";
cin >> Compoundments;
cout << "Time (Years): ";
cin >> Time;
Total_Amount =(Initial_Amount*(1+((Interest/100)/Compoundments))^(Compoundments*Time));
Net_Change = Total_Amount - Initial_Amount;
Net_Change_Year = Net_Change / Time;
Net_Change_Month = Net_Change / (Time * 12);
Net_Change_Day = Net_Change / (Time * 365);
cout << " This will result in a net change of $"<< Net_Change << " through this investment. ";
cout << " This comes out to be an average of $"<< Net_Change_Year << " a year, $"<<Net_Change_Month << " a month, or $" <<Net_Change_Day << " a day. ";
system("pause");
return 0;
}