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



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 07:58:44

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. Hi Along with your provided code below, if we are
View Tutorial          By: Roshan at 2011-05-02 12:06:27

2. Appriciated, The information is very useful and st
View Tutorial          By: Bala Gummadi at 2009-02-24 10:01:50

3. Very good explanation . i understood easily
View Tutorial          By: whyte at 2014-03-25 10:12:00

4. Easy to understand........ thanks man
View Tutorial          By: vikash bhardwaj at 2013-06-25 07:07:54

5. <uses-permission android:name="android.per
View Tutorial          By: Dev at 2012-04-06 06:19:03

6. sir,
my project is in asp.net so is ther

View Tutorial          By: mohsin at 2011-04-14 06:25:59

7. So, is it possible to use the getClass() and getRe
View Tutorial          By: cee at 2014-11-29 14:27:10

8. Thank you so much
View Tutorial          By: Daniel at 2011-02-14 22:47:05

9. Sir , I am doing B.Tech . I want to know more abou
View Tutorial          By: Rakesh yadav at 2011-01-18 22:23:22

10. Thanks for the explanation.
It makes sense

View Tutorial          By: Miguel JImenez at 2009-05-10 14:28:46