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
efficient cleaning crew Northbrook ..In this small article we will be looking at the... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
Microsoft CRM is CRM answer from Microsoft and attempt to... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
The purpose of Project Management Software is to provide an... Read More
After seeing many people complain about their weak Internet security... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
First we had the original Google search that evolved into... Read More
Should one use Windows Update?This topic has good and valid... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Not every software testing project can or should be automated.... Read More
Microsoft Business Solutions CRM is web-based CRM application, deploying all... Read More
GroupwareThe internet is full of 1.5 million to 7 million... Read More
The most important benefit of XML is its simplicity. Though... Read More
If you have Microsoft Great Plains and support it for... Read More
The fact that a software tester is a most infamous... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
The destruction of the Soviet Union about 15 years ago,... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
We live in a post-industrial age where information is the... Read More
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
If you have been using the Internet for any amount... Read More
cleaning lady near Wilmette ..CD and DVD replication is a process that works by... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
TikiWiki is open source software - it is written in... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
If you copy something from a Web site or elsewhere...... Read More
Not all of us have the luxury of working both... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Designing without tables by using CSS layouts is fast becoming... Read More
1. What determines the software price? Is it Per Seat... Read More
Adware is a type of Spyware program that displays some... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Scrapbooks are very popular these days. I think that almost... Read More
Executive SummaryAn effective plan for entering, cleaning and updating the... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
In the Clinton era the status quo was simple: you... Read More
While I was in college, if you would have asked... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
In linux, one of great commands for finding out information... Read More
When my daughter was getting into AOL instant messaging (AIM)... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
In this short FAQ style article we would like to... Read More
Anti-virus software is used to find, remove or fix files... Read More
Software |