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
maid service near Mundelein ..IBM Lotus Notes with Domino email server is traditional document... Read More
MS CRM is very close to document workflow automation, including... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
Whether you have used Microsoft Word for years, have just... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Microsoft Word is one of the most popular office applications... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
Here is some free software tools to help you build... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Accounts payable is just one area of office management where... Read More
Bar charts, bar graphs, and any other chart or graph... Read More
Many Webmasters have never bothered to view their website's server... Read More
Mike Dunville* had a decision to make. As the new... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
So, you've bought a new Macintosh, and now you may... Read More
It would be easy to think, like most people apparently... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
Microsoft Business Solutions ? Navision is an integrated solution for... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
high-end home cleaning Bannockburn ..I love new technology. I am still ready to wait... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
Best Software Act! is very popular CRM for small and... Read More
If you feel intimidated when someone tries to teach you... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Since Version 8.0 Microsoft Business Solutions Great Plains & Great... Read More
It???s easy to understand why you might be drawn to... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
You would like to protect your documents, wouldn't you? Reasons... Read More
Each Industry and market niche has business specific and unique... Read More
I suggest that you do not spend a lot of... Read More
Whether you have used Microsoft Word for years, have just... Read More
When you need a phone number, you do a quick... Read More
Designing without tables by using CSS layouts is fast becoming... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
It is really interesting that a bug can create problem... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
Are you a database professional? Do you work with a... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
The Internet is reshaping every form of communications medium, and... Read More
You've finally created databases that you can actually use to... Read More
Software |