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. How to draw a thick circle in midlet?
View Tutorial          By: masi at 2011-12-01 11:47:00

2. public class zcxzcStack
{
//push fun

View Tutorial          By: eissen at 2014-09-22 13:32:20

3. Good Example ...For Both FIleWriter and FileReader
View Tutorial          By: karthikeyan.v at 2009-11-17 02:27:42

4. Very Useful tutorial for beginners.. Thanx
View Tutorial          By: Rohini at 2010-02-23 23:16:16

5. Hi Shiva,
Comparator interface is used to o

View Tutorial          By: Srinath at 2015-04-19 08:23:20

6. this site is very useful to the freshers ...

View Tutorial          By: sweth at 2009-09-02 18:53:46

7. Better theory for those who have just started.

View Tutorial          By: kunal at 2010-05-13 05:55:05

8. hai...
i am completed MCA am good at java.

View Tutorial          By: HEMALATHA at 2013-08-03 10:04:57

9. I get an error returned saying the SMPT server req
View Tutorial          By: Christian Peut at 2011-04-04 04:35:51

10. how to downlow the different 5 files please !!
View Tutorial          By: Agnin at 2009-06-24 05:29:09