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
cleaning help near Mundelein ..Several software companies design programs for preventive maintenance. Most of... Read More
In this article you will find some background information about... Read More
If you are software developer or database administrator - we... Read More
When you double-click a layer in the Layer Palette, you... Read More
This article is the third of a series of articles... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
If there still are few unprotected computers left, I haven't... Read More
The US House of Representatives has recently passed the "Spy... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
If you've been using MySQL database to store your important... Read More
Looks like Microsoft Great Plains becomes more... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
Preventive Maintenance (PM) is defined as scheduled work done on... Read More
If you company is small or mid-size special products or... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
If you have been using the Internet for any amount... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
There are so many different programs that clutter up your... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Microsoft Business Solutions Great Plains as new ERP for multinational... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
One day, you suddenly realize that your computer started to... Read More
reliable maid service Wilmette ..Microsoft Business Solutions CRM is web-based CRM application, deploying all... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Research bears that less than 70 percent of development projects... Read More
NOTE: Please take time to read on - it may... Read More
Using professional icons in your application or website can bring... Read More
Make-or-Break Factors in Success and ProfitabilityFor quick printers, estimating can... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
Today's business world is fast-paced. No matter what it is... Read More
When you think... Read More
Trying to figure out a stream in banning one email... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
With thousands of web pages added to the Net every... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
The Windows Indexing Service provides you with the ability to... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
Software |