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



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 12:47:54

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. This example has helped me a lot.! kudos to the wr
View Tutorial          By: Disha Sareen at 2014-12-24 09:30:12

2. left shift output is wrong, for this results so ma
View Tutorial          By: naga sudha at 2011-04-20 04:26:40

3. thanx for this post...its my exam of java day afte
View Tutorial          By: Prakhar at 2012-01-08 00:16:24

4. not work
View Tutorial          By: kkbb at 2011-03-12 03:52:06

5. In the 2nd example ,during the creation on object
View Tutorial          By: priyanka thakur at 2011-08-29 20:24:16

6. Good and optimum introduction to J2ME application
View Tutorial          By: [email protected] at 2013-01-14 10:37:57

7. super example...it very useful for me...
View Tutorial          By: elan at 2011-06-02 07:54:39

8. The tutorial is simple and clear.
@Gnani, i

View Tutorial          By: Tayo at 2010-01-03 13:10:24

9. sir, am doing my mca project in java based on netw
View Tutorial          By: saravanapriya at 2011-11-24 03:25:06

10. Pl provide me code to send sms using USB modems.
View Tutorial          By: Prayag Singh at 2010-09-27 22:50:34