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. can I ask question? how to make a complete program
View Tutorial          By: manuel at 2012-08-13 10:06:24

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

3. I had just copied the code & tried to execute
View Tutorial          By: dhananjay padalkar at 2010-02-13 19:20:27

4. HOW TO SET PASSWORD IN JAVA.....
View Tutorial          By: NAKUL at 2012-12-14 05:23:16

5. I'd like to Thanks first bcoz your program is real
View Tutorial          By: Pawan at 2012-04-24 19:46:00

6. very good and very simple for beginers
View Tutorial          By: Biju Thomas at 2010-08-17 08:09:30

7. I used a txt file and stored it under my drawable
View Tutorial          By: Sara at 2014-09-18 16:33:30

8. hi .the program does run thank you for that ,i nee
View Tutorial          By: mazen at 2008-09-09 04:55:16

9. Whenever i run this program, it terminates immedia
View Tutorial          By: Salman at 2015-03-26 08:23:32

10. Hello, I have a problem
I cant understand s

View Tutorial          By: henry at 2012-01-10 07:53:05