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 , I like ur explanation but I need to knw wat i
View Tutorial          By: prabhakara at 2010-09-22 06:28:13

2. Great Job
View Tutorial          By: Niteen Dhule at 2015-02-09 06:37:03

3. Hello to Every one!! :-),HERE I'AM NOT WRITING A C
View Tutorial          By: Pulkit Malviya at 2012-08-26 14:56:18

4. very superb
View Tutorial          By: bala at 2008-05-14 04:49:24

5. its easy to understand the complete history of jav
View Tutorial          By: Arun Tony at 2011-04-10 07:12:04

6. What kind of elements can be stored in arraylist ?
View Tutorial          By: Himanshu at 2009-09-17 00:00:41

7. OK 0
COM1
javax.comm.CommPortIdenti

View Tutorial          By: sruthi at 2013-01-20 10:37:41

8. Showing code with quote tags is pretty rubbish. :/
View Tutorial          By: Daniel Jonsson at 2011-09-01 14:01:04

9. thks for help...
View Tutorial          By: Peps at 2010-01-05 02:34:15

10. Finally! You enlighted me in a small problem: it w
View Tutorial          By: Fernando Martin at 2011-02-25 12:54:58