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. HI.....

javax.comm.NoSuchPortExcept

View Tutorial          By: RAHUL at 2010-12-28 22:59:41

2. i am new to java, please send simple programs, and
View Tutorial          By: jegan at 2011-07-11 02:22:37

3. Thanks a lot .. Great work!!
View Tutorial          By: MonamAlwerfally at 2013-03-26 14:41:29

4. i am not getting output by using this code..after
View Tutorial          By: dhaval at 2011-01-03 03:42:28

5. can anyone explain the output of this recursive ex
View Tutorial          By: vipul at 2012-08-12 19:41:19

6. hi.I am new in j2me and really want to learn more
View Tutorial          By: Deepak kumar at 2010-11-15 03:04:15

7. Could you somehow use the substring method to pars
View Tutorial          By: Eric at 2009-04-26 19:20:26

8. Thanks a lot! This really helped!!!
View Tutorial          By: SuperSeppel13 at 2009-04-14 04:25:06

9. Thanks! It worked fine for me.
View Tutorial          By: John Franklin at 2009-04-02 10:37:44

10. Very cool one, thanks, got the concept clear
View Tutorial          By: black boot at 2010-04-18 08:20:20