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. Hello guys, the code above is the full complete co
View Tutorial          By: Dalma at 2012-10-03 02:50:33

2. Thanks a lot :-) It is very informative
View Tutorial          By: praveen at 2010-05-03 22:17:19

3. when i was running this code... it is giving me th
View Tutorial          By: Nilesh Agrawal at 2012-06-08 15:08:25

4. This code is only for send sms? can it also alert
View Tutorial          By: abdul kadir at 2009-10-23 05:37:46

5. Just used InstallCert.java successfully so that my
View Tutorial          By: Anthony Pelosi at 2009-12-30 15:52:17

6. please help me to do find a push and pop operation
View Tutorial          By: sweet mae at 2011-01-14 00:01:33

7. This is great, hope to learn more from this commun
View Tutorial          By: Wamaguru at 2014-07-12 09:05:30

8. is there any port filter/block api for java?
View Tutorial          By: edwin at 2010-08-12 03:16:44

9. What is meant ClasspathResource why do we use it i
View Tutorial          By: anil kumar at 2008-06-03 05:41:36

10. hello!!can anyone help me. can you send me the com
View Tutorial          By: denisse at 2008-01-07 05:40:25