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 ..Great Plains Integration Manager scripting and translation - overview for... Read More
Logistics automation is often considered as barcoding extension to Sales... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
In the previous ISDN article, we looked at how and... Read More
Whether you have used Microsoft Word for years, have just... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Considering whether or not your software company should hire a... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
So, you've bought a new Macintosh, and now you may... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
The first topic we are going to discuss... Read More
Now that spyware is the single most dangerous threat to... Read More
Great Plains Fixed Assets Management module is a robust tool... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
FTP stands for "file transfer protocol". FTP is basically a... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
In part III of this ISDN primer, we learned that... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
All of us know that Microsoft bought former Great Plains... Read More
If you've been using MySQL database to store your important... Read More
We'll give you non formal view, based on our consulting... Read More
ERP Consulting industry is on the way to serve clients... Read More
last minute cleaning help Highland Park ..The world of small business accounting software can be a... Read More
Case study: A secretary using Corel WordPerfect 7 is often... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
I've been active in the Cisco Certification track for four... Read More
I have always regretted how Microsoft price gouges and rips... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
There are many commands that are used in linux on... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions.The whole... Read More
Crystal Reports is the most flexible tool on the market... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Before September 1995, Microsoft Windows was an MS-DOS program. DOS... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
Microsoft Great Plains is main mid-market application from Microsoft Business... Read More
Domino server is a buffer between the operation system and... Read More
Microsoft Office program is a programming tool called Visual Basic... Read More
An integral part of any quality CRM system is lead... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Before being able to choose a secure Internet communication system,... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
How would you like to prevent spyware and adware from... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
It's no secret that software companies operate in a very... Read More
Software |