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 ..We would like first emphasize the change in the paradigm.... Read More
When it comes to screenplay software each screenwriter needs to... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
Did you ever want to erase everything on your computer?... Read More
This tutorial covers OLAP solutions used by Data warehouses and... Read More
Think of this, first we had the HAM Radio, then... Read More
It???s easy to understand why you might be drawn to... Read More
We all already got used to computer monitoring both at... Read More
Buying accounting software is a major investment. It's an important... Read More
The purpose of one of our projects was MS Exchange... Read More
Now that spyware is the single most dangerous threat to... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
Software development is a risky business.Many software developers are barely... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
Microsoft CRM is now on the scene and it is... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
Google Inc. has launched a new software package that allows... Read More
Handling character strings in Java is supported through two final... Read More
reliable maid service Wilmette ..Microsoft Great Plains is now targeting large and midsize businesses... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Make-or-Break Factors in Success and ProfitabilityFor quick printers, estimating can... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
The adware and spyware definitions list is very long. But... Read More
What is Software?Software is a set of instruction written to... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
Finally, you have some time to personalize your desktop with... Read More
Whether you are a small consultancy firm, a medium sized... Read More
The java programming language is becoming more and more popular... Read More
Microsoft Great Plains is becoming more and more popular and... Read More
There are two approaches for application integration:? Programmer's approach ?... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Do you want to get quality software at a reasonable... Read More
Microsoft Business Solutions is now in process of creating so... Read More
All your software is stored on a hard-drive. But how... Read More
One day, you suddenly realize that your computer started to... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
Software |