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
weekly home cleaning Highland Park ..People often ask me: What image file formats will Photoshop... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
MS CRM is very close to document workflow automation, including... Read More
Microsoft Business Solutions ? Navision is an integrated solution for... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
If you have Microsoft Great Plains and support it... Read More
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
It would be easy to think, like most people apparently... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
And kill the best layout software in the process of... Read More
Linux essentials:It's free for download but you have to pay... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
Following tips help you to learn a software in lesser... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions.The whole... Read More
In linux, one of great commands for finding out information... Read More
Buying accounting software is a major investment. It's an important... Read More
In order to implement VLANs in a network environment, you'll... Read More
The most important things you can do for your computer... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
whole house cleaning Park Ridge ..Just stress testing one of the latest Linux distributions. Been... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Preventive Maintenance (PM) is defined as scheduled work done on... Read More
Logistics automation is often considered as barcoding extension to Sales... Read More
I have always had a tendency to focus on the... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
Find out why Spyware Removal from computers is important and... Read More
It won't matter how effective your WinRunner Team is if... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Bill of Lading is required report for Logistics and Freight... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
There are certain pluses and minuses in both cases and... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Think of this, first we had the HAM Radio, then... Read More
IntroductionDuring the early years of our modern computer era, very... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
The purpose of one of our projects was MS Exchange... Read More
Trying to figure out a stream in banning one email... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Software |