Answer:
#include <iostream>
using namespace std;
int main()
{
double minutes, cost = 0;
cout<<"Enter the number of minutes: ";
cin >> minutes;
if (minutes <= 3)
cost = 1.99 + (minutes * 2);
else
cost = 1.99 + (2 * 3 + (minutes - 3) *0.45);
cout <<"The cost is: " << cost <<endl;
return 0;
}
Step-by-step explanation:
Declare the variables
Ask the user for the minutes
Check the minutes:
If it is less than or equal to 3, calculate the cost by summing multiplication of the minutes by 2 and 1.99
Otherwise, calculate the cost by summing the multiplication of the first 3 minutes by 2, multiplication of the remaining minutes by 0.45 and 1.99
Print the the cost