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. Great explanations! I looked for other guides and
View Tutorial          By: A.Lepe at 2010-09-15 21:36:42

2. Hi Sir...
sir i am a student and I am worki

View Tutorial          By: shanthi at 2013-03-22 11:01:15

3. I'm getting the following error even after several
View Tutorial          By: Joe85 at 2011-03-18 08:58:04

4. This one is helpful. Thanks

Is th

View Tutorial          By: Umesh Aawte at 2009-06-23 06:43:55

5. i really have to thank you for the wonderful fluid
View Tutorial          By: Joel Pereira at 2011-03-19 22:08:58

6. Thanks to OP and Zarno for finishing off this code
View Tutorial          By: Soapy Balls at 2011-05-27 05:26:13

7. Getting Invalid IPv4 format J2me Midp 2.0, Asp.net
View Tutorial          By: Anup at 2013-01-02 05:11:51

8. class Foo implements Runnable{


View Tutorial          By: DeeNKHAN at 2013-03-02 06:54:13

9. very good to use
View Tutorial          By: baby at 2013-06-14 12:08:14

10. class Factorial
{
int fact(int

View Tutorial          By: soph at 2013-02-06 06:49:07