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
tidy up service Glenview ..Looking at all the ads which promise to get rid... Read More
Not all of us have the luxury of working both... Read More
You would like to protect your documents, wouldn't you? Reasons... Read More
1. What determines the software price? Is it Per Seat... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Three highly respected names in Human Resources have joined forces... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Google Inc. has launched a new software package that allows... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
You've finally created databases that you can actually use to... Read More
A UNIX Shell is in simplest terms, a command line... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
Now there are Three Steps To Heaven Just listen and... Read More
Today's business world is fast-paced. No matter what it is... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
When you first think about multicurrency ? you probably have... Read More
How would you like to prevent spyware and adware from... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
While Adobe is the most known maker of PDF tools,... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
maid service near Winnetka ..If you have Microsoft Great Plains and support it for... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
In the real world a "fire wall" is a fireproof... Read More
At the end of XX century, in the late 1990th... Read More
Ok... Where to start?Well, I guess I will start at... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
When my daughter was getting into AOL instant messaging (AIM)... Read More
Microsoft Outlook is one of the most widely used software... Read More
When you double-click a layer in the Layer Palette, you... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
1. With mapping software you can create a report that... Read More
Microsoft Office program is a programming tool called Visual Basic... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
Usually, the easiest way to tell you have spyware is... Read More
This is the tutorial where we really get into programming.... Read More
When you buy a computer, it most likely comes with... Read More
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
While I was in college, if you would have asked... Read More
The cornerstone of successful automated office systems is the ability... Read More
Well, even if the combination might look very unusual, we... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Are you a database professional? Do you work with a... Read More
Microsoft Great Plains serves majority of US based horizontal and... Read More
Software |