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
car service from Midway Burlington .. Lockport Chicago limo O’HareWe all already got used to computer monitoring both at... Read More
The java programming language is becoming more and more popular... Read More
For a windows user like me, just can watch with... Read More
Navision Software was purchased by Microsoft and now it is... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
While Adobe is the most known maker of PDF tools,... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
When you double-click a layer in the Layer Palette, you... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
Disclaimer: All the thoughts expressed are my views only! Your... Read More
GroupwareThe internet is full of 1.5 million to 7 million... Read More
Spyware and malware are large problems for Internet users today... Read More
The software giants don't do everything and don't always produce... Read More
Did you ever want to erase everything on your computer?... Read More
We don't think about mainframe software pricing anymore, we just... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
Not all of us have the luxury of working both... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Granger limo Chicago ..Remember nice and prosperous Clinton era? When you implemented innovative... Read More
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
Are you a whiz at calculating financial information? Not the... Read More
Fleet Maintenance Management is a critical position in any company... Read More
Learning how to program software seems like a daunting task... Read More
The cornerstone of successful automated office systems is the ability... Read More
MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More
We would like to give you pluses and minuses of... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
There are so many different programs that clutter up your... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More
Looks like Microsoft Great Plains becomes more... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
Intro This concise article will tell you in plain English... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
Microsoft Business Solutions Great Plains as new ERP for multinational... Read More
In the new era of internet marketing the problem of... Read More
Viruses and spyware usually show up on your computer one... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
Java has come along a long way. Many would agree... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
XML parser is a software module to read documents and... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Software |