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
Let us give you - developer some hints in the... Read More
Are you one of those people that keeps track of... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
MS CRM is very close to document workflow automation, including... Read More
It is a well known fact that Java as a... Read More
There are several kinds of software piracy. The bottom line... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
If you are software developer or database administrator - we... Read More
Which Type of Shop Can Rely On A Home Built... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
The title of "software engineer" has got to be among... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
Fundraising software lets you connect with donors in a way... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Just the thought of a duel-boot scares many people away,... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
This short paper will expand on two key reasons to... Read More
CD and DVD replication is a process that works by... Read More
Document Manager and Version HistoryIn previous articles I have discussed... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
In the previous ISDN article, we looked at how and... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
How to delete the user? This is the first problem... Read More
If you have Microsoft Great Plains and support it for... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
How many steps does it take you to locate and... Read More
A UNIX Shell is in simplest terms, a command line... Read More
In order to implement VLANs in a network environment, you'll... Read More
Almost all new and major brand of PCs come with... Read More
Are you a whiz at calculating financial information? Not the... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
Java has come along a long way. Many would agree... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
Icons are used everywhere; right from software applications, to internet... Read More
What is a Web Database?A web database is a database... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Once upon a time not so long ago, there was... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
There is many things more frustrating than surfing a website... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Since technology changes so quickly, it is hard to begin... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
So let's begin crunching down these 300 images using Adobe... Read More
I suggest that you do not spend a lot of... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
It won't matter how effective your WinRunner Team is if... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
How many steps does it take you to locate and... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Shareware is software that you can try before you buy;... Read More
When Great Plains Software was designing and developing Great Plains... Read More
Whether you have used Microsoft Word for years, have just... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
Software |