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. i am new to java plz give any sample and simple ja
View Tutorial          By: sham at 2012-03-20 02:30:20

2. your web site is very useful for students
View Tutorial          By: aathithi at 2008-06-22 22:41:07

3. Thanks for your code. Nice working but I have one
View Tutorial          By: Ravinder Kumar at 2012-01-02 18:01:21

4. if u need simple definition then that are

View Tutorial          By: rizvaankhan at 2011-10-10 13:13:36

5. Sir, this is very helpful for students and profess
View Tutorial          By: Pankaj Choudhary at 2010-10-19 00:24:36

6. superb its working perfect but one thing, we have
View Tutorial          By: venkatachalam at 2013-03-14 16:35:00

7. Question: if clone is a protected method then why
View Tutorial          By: siva kiran at 2011-01-20 11:40:23

8. It's very helpful to me... Thanks...
View Tutorial          By: Nicks Patel at 2010-03-24 23:37:04

9. Error loading win32com: java.lang.UnsatisfiedLinkE
View Tutorial          By: Dinesh557 at 2008-09-23 04:18:47

10. nice explanation.I want to write contents of file
View Tutorial          By: aparna at 2013-02-05 13:17:36