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. U should give the output also.. then only it will
View Tutorial          By: Mohamed Younus at 2011-07-07 10:13:54

2. its good
View Tutorial          By: sumanth at 2010-04-10 20:10:00

3. Works great, thanks! However, is there any way to
View Tutorial          By: MisterCrow at 2013-04-30 11:56:49

4. Sometimes java do support operator overloading as
View Tutorial          By: Gunjan Srivastava at 2011-07-06 09:14:00

5. I am suffering with the same error as of ganesh...
View Tutorial          By: Sri Bhavani at 2008-09-30 00:18:38

6. Thanks :)
View Tutorial          By: Anuj Bhatnagar at 2015-05-06 14:02:19

7. A more complete description of the common pitfalls
View Tutorial          By: Phil at 2012-11-25 02:06:49

8. what is the use of int getch(void)
and unge

View Tutorial          By: sania at 2014-06-04 17:15:30

9. Can you give me an example to create InetAddress f
View Tutorial          By: Vaibhav at 2009-12-15 23:37:49

10. why we use int with main
View Tutorial          By: praveen at 2012-03-26 04:28:20