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
house refresh service Lincolnshire ..Shareware is software that you can try before you buy;... Read More
Music downloads are off the charts! We're listening to digital... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
Are you a whiz at calculating financial information? Not the... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
There are so many different programs that clutter up your... Read More
You turn on your computer, and it doesn't look quite... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
In the real world a "fire wall" is a fireproof... Read More
In the early days of the personal computer, we're talking... Read More
The fact that a software tester is a most infamous... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
If you are in a business that passes documents around... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
When you think... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
I have recently created my first Php program. I wanted... Read More
licensed cleaning services Lake Forest ..Now there are Three Steps To Heaven Just listen and... Read More
In order to implement VLANs in a network environment, you'll... Read More
Icons are used everywhere; right from software applications, to internet... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
All your software is stored on a hard-drive. But how... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
Spyware and malware are large problems for Internet users today... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
The term "document management" and "paperless office" is the subject... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
This article illustrates the best practices to improve the performance... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
Preventive Maintenance (PM) is defined as scheduled work done on... Read More
Buying accounting software is a major investment. It's an important... Read More
If you are to buy a HelpDesk & Asset Management... Read More
It is now common thing when large corporation selects mid-market... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Software |