This is the tutorial where we really get into programming. Input and variables are the essence of programming. In this tutorial you will learn how to get data from the user and use variables. You will learn the types of variables there are and how to do basic math with them. At first, this may seem boring and pointless, but you have to learn it, and it should go quick.
Basic Input
When you are making a console application, here is how you should get user input. Some of you may have guessed it, you use c[b]in[/b], of course, the 'c' meaning console and the 'in' meaning input, like 'cout'. So, here is a basic code, where the name of the variable x. cin>>x;
Defining Variables
A variable is what you guessed, a number or piece of data that will vary.
The diffrent types of variables:
bool - true or false
int - whole numbers
char - character (a, b, c, etc...)
string - multiple characters (words, etc..)
float,double - numbers that can have decimals
When deciding what type of variable to use, think about what kind of data it is going to be storing and remember that some data types use more memory than others, however most of your applications will use less memory than you have. To declare a variable, write the type of variable, then the name.
Examples:
int myInt = 7;
char thisChar= 'a', otherChar = 'b', char newChar;
string password= "password";
Syntaxes
Notice how I always had the first word not capatalized, but I capatalized all the other ones. You can also define more than one at a time, and you dont always need to set the value in the begining. Also, when you use a char, use a ' and for a string a ". Try to give your variables meaningful names.
Math
This is really the heart of programming, math! For now, we are going to be doing some simple arithmetic.
The basic math functions are:
+ = addition
- = subtraction
/ = division
* = multiplication
There are a bunch more, but that is all we need for now.
Go out and make a program!
Now that you know some of that basic stuff, try making a program, and dont be afraid to ask for help on http://www.syschat.com!
Chris Silop - http://www.syschat.com, Computer Forum
MSN messenger is a pretty cool invention. I mean I'm... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
I completed an experiment recently. I wanted to find out... Read More
Each Industry and market niche has business specific and unique... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
Every day millions of new web documents emerge on the... Read More
Are you lost in the mess of documents that get... Read More
TikiWiki is open source software - it is written in... Read More
Spyware is software or hardware installed on a computer without... Read More
It's no secret that software companies operate in a very... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
It is possible that if one avoided all sources of... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
If you copy something from a Web site or elsewhere...... Read More
Program Flow is what you think it is. How the... Read More
There are plenty of articles out there about how to... Read More
Introduction: The creating of a computer program involves a number... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
This article will not attempt to advocate the use of... Read More
Music downloads are off the charts! We're listening to digital... Read More
The first topic we are going to discuss... Read More
This article is the first of a series of articles... Read More
While paper labeling CDs and DVDs may appear to be... Read More
In this small article we will be looking at the... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
This article is the fourth of a series of articles... Read More
Adware is a type of Spyware program that displays some... Read More
What is IRC?IRC is Internet Relay Chat. It is a... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
Microsoft Business Solutions is emerging as very attractive vendor for... Read More
Great Plains Integration Manager scripting and translation - overview for... Read More
The COSMIC FP (function point) software quality metric, is no... Read More
Manufacturing in the USA is far away down from mid... Read More
Three highly respected names in Human Resources have joined forces... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
Many reasons made GBM a unanimous choice for experts, one... Read More
Navision Software was purchased by Microsoft and now it is... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
We all already got used to computer monitoring both at... Read More
This short paper will expand on two key reasons to... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
Customer Relationship Management or CRM is a combination of enterprise... Read More
You've finally created databases that you can actually use to... Read More
We would like first emphasize the change in the paradigm.... Read More
And kill the best layout software in the process of... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
So let's begin crunching down these 300 images using Adobe... Read More
Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
Remember old good days when your company probably had Great... Read More
Software |