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 Ashray P Shetty,
I want assistance in th

View Tutorial          By: Shabbir Manasawala at 2010-11-19 02:02:43

2. i totally disagree with Gerardo Saldí[email protected] i
View Tutorial          By: Shivesh at 2009-09-24 23:46:42

3. good.....not bad. .show me more programs.
View Tutorial          By: saranya at 2011-12-07 08:49:39

4. If you are working with the multi-threaded program
View Tutorial          By: Prithvi at 2010-01-07 10:24:12

5. Cool it help me a lot
View Tutorial          By: urdu sms at 2009-10-06 12:16:20

6. Thank you so much. I have migrated from the .NET t
View Tutorial          By: kanika at 2011-05-31 12:23:33

7. thanks a lot man....
View Tutorial          By: Praveen at 2012-12-03 08:36:51

8. hiii
i m doing my final year project on sms

View Tutorial          By: jiya at 2010-10-21 07:58:24

9. Can anybody explain me what are the minimum settin
View Tutorial          By: Ramesh at 2010-02-25 10:28:42

10. Hi thanks for the example for overriding toString(
View Tutorial          By: Reshma at 2011-05-11 10:46:08