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
scheduled cleaning services Winnetka ..DBxtra is a powerful query and reporting tool that hides... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
The major reason I recommend getting your hands on real... Read More
Let's say that you have a software project that's under... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
Make-or-Break Factors in Success and ProfitabilityFor quick printers, estimating can... Read More
When you own a small business, time is money. And... Read More
At the end of XX century, in the late 1990th... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
In order to implement VLANs in a network environment, you'll... Read More
Pirated software is on the increase and now accounts for... Read More
Navision Software was purchased by Microsoft and now it is... Read More
If you have Microsoft Great Plains and support it... Read More
Do you want to get quality software at a reasonable... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
This tutorial covers OLAP solutions used by Data warehouses and... Read More
Corporate ERP/MRP selection might be tough one, especially considering very... Read More
Spyware and malware are large problems for Internet users today... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
Almost all new and major brand of PCs come with... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
reliable maid service Lincolnshire ..The destruction of the Soviet Union about 15 years ago,... Read More
This article is the first of a series of articles... Read More
In the early days of the personal computer, we're talking... Read More
Are you a database professional? Do you work with a... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
There is many things more frustrating than surfing a website... Read More
Well, even if the combination might look very unusual, we... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
If your company has regional and worldwide operations, you might... Read More
You might think you don't need a firewall... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
Microsoft Business Solutions offers several ERP applications: Great Plains, Navision,... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
Think of this, first we had the HAM Radio, then... Read More
(1) Avoid using the same variable again and again for... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
I have recently created my first Php program. I wanted... Read More
How would you like to prevent spyware and adware from... Read More
Let's say that you have a software project that's under... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Software |