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
express cleaning service Arlington Heights ..Need software to record your voice, streaming audio or musical... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
I have always regretted how Microsoft price gouges and rips... Read More
How do you run a program on a remote server... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
First we had the original Google search that evolved into... Read More
There are so many different programs that clutter up your... Read More
We don't think about mainframe software pricing anymore, we just... Read More
We all take the computer for granted. I mean, all... Read More
Bar charts, bar graphs, and any other chart or graph... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Microsoft Business Solutions is now in process of creating so... Read More
Java has come along a long way. Many would agree... Read More
Shareware is software that you can try before you buy;... Read More
If you have Microsoft Great Plains and support it for... Read More
What is installation in the language of technology? Installation... Read More
If you have Microsoft Great Plains as main accounting and... Read More
I like my software simple. If it's too complex or... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
Three highly respected names in Human Resources have joined forces... Read More
I suggest that you do not spend a lot of... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
tidy up service Arlington Heights ..All of us know that Microsoft bought former Great Plains... Read More
Before being able to choose a secure Internet communication system,... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
I suggest that you do not spend a lot of... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
In our opinion, traditional approach when you select ERP/MRP system... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
If you have been running Windows XP for a couple... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
Usually, the easiest way to tell you have spyware is... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
The cornerstone of successful automated office systems is the ability... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
Now there are Three Steps To Heaven Just listen and... Read More
Navision Software was purchased by Microsoft and now it is... Read More
Once upon a time not so long ago, there was... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
The adware and spyware definitions list is very long. But... Read More
Software |