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
green cleaning service Glencoe ..Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
In linux, one of great commands for finding out information... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
When my daughter was getting into AOL instant messaging (AIM)... Read More
Java has come along a long way. Many would agree... Read More
Microsoft Business Solutions offers several ERP applications: Great Plains, Navision,... Read More
It's all about turn times in the eMedia industry! The... Read More
The title of "software engineer" has got to be among... Read More
There is many things more frustrating than surfing a website... Read More
One of the main reasons business owners and entrepreneurs use... Read More
Each Industry and market niche has business specific and unique... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
Did you ever want to erase everything on your computer?... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
A few months back I really got sick of my... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Well, even if the combination might look very unusual, we... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
Microsoft Great Plains fits to majority of industries, in the... Read More
The Windows registry is a huge database that ensures normal... Read More
The major reason I recommend getting your hands on real... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
Pirated software is on the increase and now accounts for... Read More
house cleaning company Bannockburn ..Microsoft Business Solutions Great Plains is very good fit for... Read More
FTP stands for "file transfer protocol". FTP is basically a... Read More
We all already got used to computer monitoring both at... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
In this small article we will show you the possible... Read More
I provide, here clear explanations and a count of function... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
The intentions of this short tutorial are not to teach... Read More
Google Inc. has launched a new software package that allows... Read More
One of the main reasons business owners and entrepreneurs use... Read More
XML parser is a software module to read documents and... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Now that spyware is the single most dangerous threat to... Read More
Microsoft CRM is now on the scene and it is... Read More
Adobe Photoshop is one of the world's leading graphics editing... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
It's all about turn times in the eMedia industry! The... Read More
In order to implement VLANs in a network environment, you'll... Read More
The fact that a software tester is a most infamous... Read More
People often ask me: What image file formats will Photoshop... Read More
Learning how to program software seems like a daunting task... Read More
Software |