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
family-safe home cleaners Morton Grove ..Formatting and reinstalling windows 98 is very easy if you... Read More
When you buy a computer, it most likely comes with... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
The most important benefit of XML is its simplicity. Though... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
Microsoft CRM is new player on the CRM software... Read More
The Windows registry is a huge database that ensures normal... Read More
Beginning with Domino version R4 it has integration with the... Read More
I like my software simple. If it's too complex or... Read More
Almost all new and major brand of PCs come with... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
I love new technology. I am still ready to wait... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
In the new era of internet marketing the problem of... Read More
Microsoft Business Solutions ? Navision is an integrated solution for... Read More
For those who are unclear on the differences between the... Read More
When you own a small business, time is money. And... Read More
Former Great Plains Software Dynamics/eEnterprise, and currently Microsoft Business Solutions... Read More
Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
Let's say that you have a software project that's under... Read More
Every day millions of new web documents emerge on the... Read More
home cleaning services Wilmette ..If there still are few unprotected computers left, I haven't... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
User interfaces and accessibility are some of the most important... Read More
When making a decision to buy any piece of software... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
For those who are unclear on the differences between the... Read More
Trying to figure out a stream in banning one email... Read More
Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Are you a whiz at calculating financial information? Not the... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
I provide, here clear explanations and a count of function... Read More
If you feel intimidated when someone tries to teach you... Read More
And kill the best layout software in the process of... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Icons are used everywhere; right from software applications, to internet... Read More
Whether you are an experienced web programmer or a complete... Read More
Disclaimer: All the thoughts expressed are my views only! Your... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
The vast majority of us will have, at some point,... Read More
Fundraising software lets you connect with donors in a way... Read More
Software |