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
bmw rental chicago Bath .. Lockport Chicago limo O’HareMicrosoft Business Solutions ? Great Plains is designed to meet... Read More
Great Plains Purchase Order Processing (POP) module makes up one-third... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
There are many commands that are used in linux on... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
Now that spyware is the single most dangerous threat to... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
When Windows fails to boot it is normally caused by... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions. If... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
If you are software developer or database administrator - we... Read More
Having from five to ten and more favorite screensavers is... Read More
Now is the time to look at an alternative to... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Whether you are a small consultancy firm, a medium sized... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
And kill the best layout software in the process of... Read More
It won't matter how effective your WinRunner Team is if... Read More
limousine service Ava ..1. What determines the software price? Is it Per Seat... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
One of the things we can be as certain of... Read More
In the real world a "fire wall" is a fireproof... Read More
All of us know that Microsoft bought former Great Plains... Read More
Viruses and spyware usually show up on your computer one... Read More
All your software is stored on a hard-drive. But how... Read More
When you buy a computer, it most likely comes with... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
Just the thought of a duel-boot scares many people away,... Read More
As seeing large number of implementations ? in our case... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
The cornerstone of successful automated office systems is the ability... Read More
In a previous article, I wrote about OpenOffice... Read More
Microsoft Business Solutions is now in process of creating so... Read More
Sales are all about leverage, because there is only so... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Adware is a type of Spyware program that displays some... Read More
This article is the first of a series of articles... Read More
Manufacturing in the USA is far away down from mid... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
Since Version 8.0 Microsoft Business Solutions Great Plains & Great... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
Software |