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
maide service in Lincolnshire ..Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
We live in a post-industrial age where information is the... Read More
Just the thought of a duel-boot scares many people away,... Read More
The term "document management" and "paperless office" is the subject... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
MS CRM is very close to document workflow automation, including... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Considering whether or not your software company should hire a... Read More
Anti-virus software is used to find, remove or fix files... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
During the years of our consulting practice, which comes back... Read More
User interfaces and accessibility are some of the most important... Read More
Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
Google Inc. has launched a new software package that allows... Read More
Enabling Chinese input is quick and easy, there are only... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
cleaning lady near Deerfield ..I have always regretted how Microsoft price gouges and rips... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
Best Software Act! is very popular CRM for small and... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
The major reason I recommend getting your hands on real... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
As we could imagine, if you are reading this article... Read More
Hi, Guys,I believe a lot of programmers are trying to... Read More
If your company has regional and worldwide operations, you might... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
It would be easy to think, like most people apparently... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
When Windows fails to boot it is normally caused by... Read More
We would like to give you several situations, when you... Read More
Microsoft Business Solutions products: Great Plains, MS CRM, Navision, Axapta,... Read More
Need software to record your voice, streaming audio or musical... Read More
It is a well known fact that Java as a... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
We are in a transition phase in the Managerial Administration... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Software |