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
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. Can u tell it can also use for connecting to oracl
View Tutorial By: Ankur Jain at 2010-08-06 05:31:08
2. can u tell me mobile tracker code in j2me
w
View Tutorial By: aiyaz at 2010-08-21 16:29:08
3. thank you for this quick and easy demonstration. B
View Tutorial By: rajesh at 2012-09-20 17:48:17
4. i need help for my study, i need an algorithm for
View Tutorial By: Vincent at 2011-08-17 13:37:52
5. thank you. its very useful :)
View Tutorial By: Farhanna at 2013-05-22 05:33:46
6. for ex
public class test()
{
View Tutorial By: Anundhara at 2012-08-11 06:54:57
7. nice info on struts and very good explanation
View Tutorial By: bharadwaj kvnss at 2013-02-07 17:18:44
8. it should be:
/* --------------- */
View Tutorial By: Ryba at 2010-05-19 15:45:48
9. @pawan: Wow. Your comment is museum-quality art, a
View Tutorial By: Steve at 2013-02-21 20:30:47
10. It worked. Thank U!
View Tutorial By: Abhijit Kurane at 2010-12-27 11:01:48