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
house refresh service Morton Grove ..Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
... Read More
TikiWiki is open source software - it is written in... Read More
If you look back to the history, you will see... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
While I was preparing some personal background information for a... Read More
One of the things we can be as certain of... Read More
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More
Do you remember that frustrating feeling when you find an... Read More
If you have Microsoft Great Plains as main accounting and... Read More
ERP Consulting industry is on the way to serve clients... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
Think of this, first we had the HAM Radio, then... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
What is a Web Database?A web database is a database... Read More
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
Crystal Reports is the most flexible tool on the market... Read More
People often ask me: What image file formats will Photoshop... Read More
Whether you are an experienced web programmer or a complete... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
cleaning service near Mundelein ..The most important things you can do for your computer... Read More
I've been active in the Cisco Certification track for four... Read More
Once upon a time not so long ago, there was... Read More
Domino server is a buffer between the operation system and... Read More
Bill of Lading is required report for Logistics and Freight... Read More
Today's business world is fast-paced. No matter what it is... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
And kill the best layout software in the process of... Read More
When reading an article where some term is used often,... Read More
The major reason I recommend getting your hands on real... Read More
When Great Plains Software was designing and developing Great Plains... Read More
I like my software simple. If it's too complex or... Read More
Cyberspace has opened up a new frontier with exciting possibilities... Read More
If you have Microsoft Great Plains and support it for... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
If you have been using the Internet for any amount... Read More
Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
If you look back to the history, you will see... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
What is Software?Software is a set of instruction written to... Read More
Spyware and malware are large problems for Internet users today... Read More
Software |