Comment on Tutorial - The if Statement in C++ By Priya



Comment Added by : Zohaib Farooq

Comment Added at : 2011-05-23 12:47:54

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! this coding is very helpful for me thanks .
View Tutorial          By: bhuvaneshwari at 2009-10-18 23:52:58

2. thanks for your explanation, but for desired outpu
View Tutorial          By: bismillah at 2010-09-02 10:16:09

3. How to display the ARP Mapping Table of a given ho
View Tutorial          By: Hala at 2013-11-15 22:42:36

4. Nice info. I must say about this post.
than

View Tutorial          By: Ganesh Prasad at 2012-10-30 05:51:49

5. Thanks :)
View Tutorial          By: Anuj Bhatnagar at 2015-05-06 14:02:19

6. Hello to Every one!! :-),HERE I'AM NOT WRITING A C
View Tutorial          By: Pulkit Malviya at 2012-08-26 14:56:18

7. Nice stuff u guyzz are sharing
View Tutorial          By: kunal sharma at 2013-11-19 03:45:08

8. Out of -1, 0, and 1 which one can I use as second
View Tutorial          By: Sanjay Bhosale at 2011-12-06 13:17:54

9. The tutorial, it's very easy to be understood

View Tutorial          By: newcomer at 2012-04-25 03:49:35

10. thanks for this tutorial! it's very useful
View Tutorial          By: Miguel at 2011-06-26 21:15:00