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



Ask a Question

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 nice
View Tutorial          By: keerthi at 2012-06-28 17:04:36

2. This is one of the most impotent , Helpful , Easy
View Tutorial          By: Sujay Mandal at 2012-09-21 16:24:06

3. Hello, I have executed the above code and it works
View Tutorial          By: Sana at 2010-02-01 03:50:18

4. I need a sample jsp(using Struts html tags) in thr
View Tutorial          By: Anil Kumar at 2008-10-23 04:14:51

5. providing explanation about the topics is very use
View Tutorial          By: vikram naidu at 2010-06-09 23:40:41

6. Sir, I need to use MS Access as a database in java
View Tutorial          By: John Moses at 2012-03-31 00:20:38

7. Great article. The simple example used easily make
View Tutorial          By: Nikhil at 2009-11-13 08:38:41

8. hey i need a sample program to draw table or grid
View Tutorial          By: pavi at 2012-10-15 04:27:27

9. thaks sir for giving information about adding int
View Tutorial          By: vijay kumar at 2012-10-10 04:59:05

10. Thanks this page is very useful for me and now I k
View Tutorial          By: Yee Wai Wyne at 2009-10-18 23:03:41