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



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 07:57:56

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. thanks a lot,nicely explained
View Tutorial          By: dhanushka at 2014-08-13 14:40:37

2. 3221225477 is C0000005 in hex notation, which is j
View Tutorial          By: Stan at 2009-06-29 12:14:25

3. if i want to write my gmail address how can i prov
View Tutorial          By: asmcn at 2011-12-27 19:40:49

4. easy to understand
View Tutorial          By: shanthi at 2011-01-02 21:25:51

5. really nice tutorial
View Tutorial          By: Gaurav Balyan at 2012-01-03 11:07:05

6. Good Article. Small and Sweet...
View Tutorial          By: Anupam Pawar at 2009-05-27 03:04:08

7. Real Life example of using Volatile
*******

View Tutorial          By: Mayank at 2011-01-25 15:44:21

8. it is very useful and in understandable manner
View Tutorial          By: Deepika at 2012-03-26 05:10:15

9. Hi there! the coding are SUPERB..bt i do nd help i
View Tutorial          By: lily sandra at 2008-01-15 18:30:33

10. ..how if the input is THE DOG BARKS then the outpu
View Tutorial          By: dharel at 2011-01-28 02:53:19