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. its very helpful and understandable.thanq
View Tutorial          By: Deepika darapaneni at 2012-03-24 14:16:39

2. good resource
View Tutorial          By: AJITH C K at 2013-04-10 17:45:51

3. 1==how can we use vb.net web service data in JSF?<
View Tutorial          By: kumaraswamy at 2009-01-06 23:56:53

4. Thanks Steven, That is an exhaustive list of diffe
View Tutorial          By: Robert at 2008-12-08 22:17:47

5. You just save ma arse, had a SQLite database, and
View Tutorial          By: codeRealm at 2011-11-13 12:58:05

6. Thank so much it helped me God bless :)
View Tutorial          By: Judito at 2014-06-14 06:52:18

7. (i'm a senior PHP programmer, but a newbie in JSP,
View Tutorial          By: LOL at 2013-03-22 08:57:21

8. is there a way to notify a specific thread?
View Tutorial          By: bob at 2010-03-23 11:57:29

9. this site is excellent & too easy to understan
View Tutorial          By: Gaurav Kushwaha at 2010-08-16 06:30:45

10. HI there, thanks for taking time to write this dow
View Tutorial          By: nick at 2012-07-31 10:41:47