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



Ask a Question

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. thanks for this pertinent remark.
View Tutorial          By: mohammed at 2009-02-21 05:43:11

2. Hi Rajesh, you have found the right site. look at
View Tutorial          By: mohan at 2008-07-27 08:55:17

3. can any body help to get the code for receiving SM
View Tutorial          By: ash at 2008-05-15 01:07:19

4. Thanks..
Short & Sweet Description.

View Tutorial          By: Prashaad at 2012-02-23 17:37:14

5. nice tutorial with discussion
View Tutorial          By: Md Firoz at 2012-01-07 11:00:29

6. Hello,

I was able to rectify port/

View Tutorial          By: Harsh at 2011-10-09 16:54:06

7. Thank you
View Tutorial          By: Angeline at 2011-06-28 06:27:12

8. hi, would you please send me the detail to impleme
View Tutorial          By: nayeem at 2009-03-13 08:47:27

9. I need code for read write mifare 1k card using No
View Tutorial          By: amarendra at 2010-12-02 21:12:08

10. Article from Java Complete Reference
View Tutorial          By: venkatesh at 2013-06-04 01:29:02