im trying to write a program that contains if , else. when i compile it there are no errors, but when you run it it will only give you the result of what is in the IF statement. Can anyone please help me figure out what im doing wrong? I copied and pasted what i have so far ...
Code:
#include <iostream>
#include <iomanip>
using namespace std;
const double Connect_Fee = 1.99;
const double one_to_three_min = 2.00;
const double additional_min = 0.45;
int main ()
{
int numOfMinUsed;
double amountDue;
cout << endl;
cout << fixed << showpoint;
cout << setprecision(2);
cout << "Enter the number of minutes the call lasted from "
<< "New York to New Delhi." << endl;
cin >> numOfMinUsed;
cout << endl;
if (one_to_three_min<= 3)
amountDue = Connect_Fee
+one_to_three_min;
else
amountDue = Connect_Fee
+ one_to_three_min
+ (numOfMinUsed -3) *
+ additional_min;
cout << "Amount due: $"
<< amountDue << endl;
system("pause");
return 0;
}