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



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 07:57:56

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. thanx a lot.............!!!! u r best..........
View Tutorial          By: Pratik at 2010-04-12 12:41:30

2. Can u please tell me how to compile and execute a
View Tutorial          By: RJ at 2010-04-20 01:30:10

3. thanks excellent explanation!!!!!!!!
View Tutorial          By: divya at 2012-01-01 17:37:32

4. The synchronization schedule function has been red
View Tutorial          By: Kim at 2014-11-12 10:52:13

5. i m student ,can any one help me in above code str
View Tutorial          By: devendra kumar at 2010-03-09 04:34:10

6. Good information...it help me to do mi projecto! t
View Tutorial          By: gnk at 2010-08-12 01:01:50

7. good Article!! you can add context settings in app
View Tutorial          By: Amit Nigam at 2009-06-10 07:35:20

8. Da program wont work if '#' is the first character
View Tutorial          By: Kala at 2012-09-05 00:24:59

9. thank u sir ,this helped a lot
************

View Tutorial          By: yugandharr at 2012-09-11 15:47:19

10. Dear !

Thanks for the article. Now

View Tutorial          By: Mubasher at 2013-05-04 11:37:52