I have written a program to calculate the price of a phone call. There is a $1.99 connection fee. The first 3 minutes are automatically charged: $2.00. The price of each additional minute is 45 cents. I have the code planned and written out well but it's returning an undefined symbol error. Any ideas???
#include <iostream>
#include <string>
int minutes;
float connectionFee = 1.99;
float first = 2.00;
float total;
int main()
{
cout << "How many minutes did the call last?" << endl;
cin >> minutes;
cout << endl;
if (minutes <= 3)
{
cout << "You have been charged $" << connectionFee;
cout << " for a connection fee and $" << first << " for the first three minutes.";
cout << endl << "Your total is " << connectionFee + first << endl << endl;
}
total = (minutes - 3) * .45;
{
cout << "You have been charged $" << connectionFee;
cout << " for a connection fee, $" << first << " for the first three minutes, and ";
cout << "45 cents per minute for each additional minute.";
cout << "Your total is $" << total << '.';
}
return 0;
}