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
detailed home cleaning Park Ridge ..Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
With any good luck and a good amount of hard... Read More
Looking at all the ads which promise to get rid... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
In today's business world it's all but impossible to escape... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
Let's say that you have a software project that's under... Read More
Spyware is like the new technological nuclear weapon on the... Read More
Around the same time Microsoft made its move with .Net... Read More
In the early days of the personal computer, we're talking... Read More
Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
Not all of us have the luxury of working both... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
Finally, you have some time to personalize your desktop with... Read More
The research in the field of Natural Language Processing usually... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
Microsoft Word is one of the most popular office applications... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
During the years of our consulting practice, which comes back... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
express cleaning service Des Plaines ..Ok... Where to start?Well, I guess I will start at... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
The first thing that you will notice about Linux Red... Read More
Not all of us have the luxury of working both... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Let us give you - developer some hints in the... Read More
(1) Avoid using the same variable again and again for... Read More
In the Clinton era the status quo was simple: you... Read More
Microsoft Great Plains and Microsoft CRM become more and more... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
In the new era of internet marketing the problem of... Read More
Scrapbooks are very popular these days. I think that almost... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Microsoft Outlook is one of the most widely used software... Read More
You turn on your computer, and it doesn't look quite... Read More
Anti-virus software is used to find, remove or fix files... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Software |