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
best cleaning company Lincolnshire ..Research bears that less than 70 percent of development projects... Read More
NOTE: Please take time to read on - it may... Read More
When Great Plains Software was designing and developing Great Plains... Read More
The vast majority of us will have, at some point,... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
We would like to give you pluses and minuses of... Read More
While I was preparing some personal background information for a... Read More
Anti-virus software is used to find, remove or fix files... Read More
Now is the time to look at an alternative to... Read More
Considering whether or not your software company should hire a... Read More
Remember old good days when your company probably had Great... Read More
Three highly respected names in Human Resources have joined forces... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
While Adobe is the most known maker of PDF tools,... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Spyware is software or hardware installed on a computer without... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
When you own a small business, time is money. And... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
on demand house cleaning Lake Forest ..Did you ever give a thought to the number of... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
One of the main reasons business owners and entrepreneurs use... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
If you have been using the Internet for any amount... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
What is installation in the language of technology? Installation... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
You might think you don't need a firewall... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
For a windows user like me, just can watch with... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
It is now common thing when large corporation selects mid-market... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Scrapbooks are very popular these days. I think that almost... Read More
Accounts payable is just one area of office management where... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More
Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
Software |