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
bathroom cleaning service Northbrook ..As seeing large number of implementations ? in our case... Read More
Fortunately one of the most common reasons cited for the... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
It could just be me, but my experiences with document... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More
Spyware is software or hardware installed on a computer without... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
Enabling Chinese input is quick and easy, there are only... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
So let's begin crunching down these 300 images using Adobe... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
The purpose of Project Management Software is to provide an... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
While I was in college, if you would have asked... Read More
Let us give you - developer some hints in the... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
1. With mapping software you can create a report that... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
Remember old good days when your company probably had Great... Read More
insured cleaning company Wilmette ..This tutorial covers OLAP solutions used by Data warehouses and... Read More
Remember old good days when your company probably had Great... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
If you are in the market for new staffing software,... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
2005 ? Back to the Future.What does the future hold?... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
Every day millions of new web documents emerge on the... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
If you are in a business that passes documents around... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Crystal Reports is the most flexible tool on the market... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
We all take the computer for granted. I mean, all... Read More
Microsoft Great Plains fits to majority of industries, in the... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
The most important things you can do for your computer... Read More
The purpose of Project Management Software is to provide an... Read More
Software |