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. i nice programs tks
View Tutorial          By: jai at 2011-05-09 14:09:38

2. just remember to add
<uses-permission an

View Tutorial          By: Mouad at 2013-07-22 10:47:27

3. grt tutorial
View Tutorial          By: sss at 2009-08-30 03:33:13

4. This is the solution that I also used, however, th
View Tutorial          By: Rob Ingenthron at 2012-07-18 23:06:18

5. I need you to Write me a program to initialize one
View Tutorial          By: Sayed maseer at 2015-06-20 05:09:12

6. Hi, i tried this tutorial with my own database and
View Tutorial          By: Dejan at 2015-03-18 13:06:27

7. doesn't work with 3 , 7 and 5 but with numbers hig
View Tutorial          By: asd at 2013-05-11 09:25:30

8. This is very useful example for beginners.

View Tutorial          By: Amresh at 2011-02-28 22:20:11

9. Hello,

I got an error like (Wed Ma

View Tutorial          By: narayanan at 2010-03-17 05:56:21

10. I am an MCA student i wanna know whether one can s
View Tutorial          By: RAJU.K at 2009-07-24 02:28:21