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
recurring maid service Wilmette ..Whether you are an experienced web programmer or a complete... Read More
The intentions of this short tutorial are not to teach... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
The major reason I recommend getting your hands on real... Read More
Java has come along a long way. Many would agree... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Microsoft Great Plains is becoming more and more popular and... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
This article is the fourth of a series of articles... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Do you want to get quality software at a reasonable... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Microsoft Business Solutions offers several ERP applications: Great Plains, Navision,... Read More
There is many things more frustrating than surfing a website... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Around the same time Microsoft made its move with .Net... Read More
Let's say that you have a software project that's under... Read More
last minute cleaning help Highland Park ..Did you ever want to erase everything on your computer?... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
The objective for Zandi Digital is to make available clever... Read More
If you look back to the history, you will see... Read More
Not every software testing project can or should be automated.... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
In today's business world it's all but impossible to escape... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions. If... Read More
This is a short article, written in question/answer/FAQ style to... Read More
The software giants don't do everything and don't always produce... Read More
Almost all new and major brand of PCs come with... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
User interfaces and accessibility are some of the most important... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Accounts payable is just one area of office management where... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Using professional icons in your application or website can bring... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Although statistics often is blamed for various deadly sins --... Read More
Software |