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. Tnx. Very fast learning i think.
Just make

View Tutorial          By: mahdi at 2011-07-09 20:20:39

2. I used two phrases of the security section for the
View Tutorial          By: pabo at 2010-04-05 05:22:24

3. int n = 0;
for (int m = 0; m < 5; m++) {

View Tutorial          By: max at 2011-05-26 09:41:26

4. short and very clear
View Tutorial          By: ramesh at 2009-07-22 22:27:25

5. awesome example
View Tutorial          By: jagjyot singh at 2010-01-12 20:39:04

6. good;Every one can understand
View Tutorial          By: seshu at 2011-04-26 05:11:09

7. your code error

because i try to ru

View Tutorial          By: Nasser at 2013-01-09 10:33:34

8. i wanted to know the rules how they are used like
View Tutorial          By: shlok gupta at 2012-03-24 11:44:24

9. HI I've been gettin this problem in STEP 6...How d
View Tutorial          By: Omar_sito12 at 2010-02-22 08:46:18

10. thanks 4 d inf..
View Tutorial          By: Ankur Saxena at 2012-02-10 15:31:33