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, thanks alot this code works for me , can someo
View Tutorial          By: ann at 2011-03-18 04:50:16

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

3. In my Midlet class there is a constructor which i
View Tutorial          By: nicolas at 2011-11-12 21:35:58

4. Hi All..
Wen i'm running the code..the foll

View Tutorial          By: mounika at 2008-04-26 14:27:30

5. Great Thanks
View Tutorial          By: anawaz at 2012-10-05 10:28:20

6. Its a nice article obviously. Can you put somethin
View Tutorial          By: kowser at 2009-10-06 23:44:52

7. hi,im working with a project,in which i have to se
View Tutorial          By: gomathi at 2008-12-08 09:04:35

8. good info to create package
View Tutorial          By: Nirdesh at 2012-10-01 03:45:02

9. Excelent article, I will start to use struts 2 now
View Tutorial          By: Alex at 2010-01-20 16:13:34

10. Typecasting proved very much helpful to me...esp.
View Tutorial          By: itan at 2010-05-04 01:30:24