Comment on Tutorial - The if Statement in C++ By Priya



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 12:47:54

Comment on Tutorial : The if Statement in C++ By Priya
#include<iostream>
#include<conio.h>
using namespace std;

void main()
{
float Call_Amount, Call_Duration,Additional_Minutes,Additional_Charge;
Call_Amount = 3.99;
cout<<"Please input the duration of call(in minutes):";
cin>>Call_Duration;
if (Call_Duration > 3)
{
Additional_Minutes = Call_Duration - 3;
Additional_Charge = Additional_Minutes * 0.45;
Call_Amount = Additional_Charge + Call_Amount;
cout<<Call_Amount<<endl;
cout<<"Call lasted for "<<Call_Duration<<" minutes. Call amount is "<<Call_Amount<<".";
}
else {
cout<<"wrong data";
}
getch();

}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. useful for me
View Tutorial          By: ganga at 2010-10-06 00:51:51

2. Above explanation is given in complete reference j
View Tutorial          By: Pankaj at 2013-09-14 05:48:47

3. Can u plz send me woking application (Send sms) J
View Tutorial          By: Ritanshu Goel at 2012-09-22 05:52:49

4. Hello,
I've tried the above code, but I've

View Tutorial          By: Phyo Phyo at 2009-09-14 05:32:28

5. i have a some knowledge of java . I want some exam
View Tutorial          By: kavitha at 2012-07-30 09:07:47

6. This is Nice start for programmer '
Thanks

View Tutorial          By: Sagar Ikhankar at 2011-07-22 06:12:44

7. Turning off hostname checking also turns off all s
View Tutorial          By: eric at 2014-01-30 18:09:05

8. How do use qsort to sort lines in text file?
View Tutorial          By: kenny at 2008-11-18 08:59:55

9. This example is working fine....I think BillGates
View Tutorial          By: Monoj Rath at 2010-07-15 01:27:51

10. Please help me i am getting following error messag
View Tutorial          By: Balaji at 2009-09-23 22:54:06