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. I have mobile connecting to pc 3 options come com
View Tutorial          By: Sumit Sharma at 2012-04-13 16:32:15

2. You only need 1 main method per application, not 1
View Tutorial          By: Michael at 2011-09-02 02:37:51

3. Its so very helpful
View Tutorial          By: Anurag at 2011-02-08 04:27:03

4. nice 1
View Tutorial          By: vivek at 2013-03-19 16:25:47

5. very good
View Tutorial          By: pravin gajbhiye, nagpur at 2010-05-24 01:43:30

6. i am run this code changing the SMSC (ex:+9198860
View Tutorial          By: sknand13 at 2007-11-16 03:27:52

7. thank u sir ,this helped a lot
************

View Tutorial          By: yugandharr at 2012-09-11 15:47:19

8. Its very useful to me
View Tutorial          By: suba at 2011-07-04 11:21:19

9. plz wait for your solution
View Tutorial          By: Desai Rajesh at 2010-03-11 22:00:32

10. hi, Thanks to the post.
I am stuck on step

View Tutorial          By: david_david at 2010-08-21 01:10:19