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



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. This is first time i am using this net
View Tutorial          By: selvam at 2008-08-19 00:04:44

2. i am getting an exceptions... pls help me..

View Tutorial          By: FEBI at 2014-03-08 06:01:44

3. Thanks a LOT !!
I was confused with this !

View Tutorial          By: rishabhsethi at 2012-10-31 15:07:07

4. Plz help me......its urgent
i need a code

View Tutorial          By: Nisha at 2010-03-22 00:38:42

5. what is the meaning of instantiated in abstract cl
View Tutorial          By: Manikandan MP at 2011-12-20 15:17:38

6. Hey guys, can u help me out over here..
thi

View Tutorial          By: Ridge Fernandes at 2012-01-19 04:09:45

7. Hallo every one. I am working on my project in j2m
View Tutorial          By: radhe at 2010-12-14 08:08:25

8. java program to maintain the books details like Bo
View Tutorial          By: Prabha at 2013-08-28 12:34:00

9. great explanations.. some important words are miss
View Tutorial          By: Joshua Paul at 2015-04-14 03:43:44

10. Thanks dear
View Tutorial          By: Muthin at 2009-04-29 00:32:24