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
professional maid services Deerfield ..Microsoft PowerPoint has dramatically changed the way in which academic... Read More
The vast majority of us will have, at some point,... Read More
The COSMIC FP (function point) software quality metric, is no... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
Considering whether or not your software company should hire a... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
In order to implement VLANs in a network environment, you'll... Read More
Do you remember that frustrating feeling when you find an... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
One of the main reasons business owners and entrepreneurs use... Read More
The objective for Zandi Digital is to make available clever... Read More
If you have been running Windows XP for a couple... Read More
For those who are unclear on the differences between the... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Domino server is a buffer between the operation system and... Read More
While Adobe is the most known maker of PDF tools,... Read More
Spyware is software or hardware installed on a computer without... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
We would like first emphasize the change in the paradigm.... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
NOTE: Please take time to read on - it may... Read More
quick home cleaning Lake Forest ..Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
In the new era of internet marketing the problem of... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
First we had the original Google search that evolved into... Read More
A wiki is an editable text-based website. But you don't... Read More
And kill the best layout software in the process of... Read More
Scrapbooks are very popular these days. I think that almost... Read More
If your company has regional and worldwide operations, you might... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
Does Microsoft care for WebmastersIt's always been a problem with... Read More
This is a short article, written in question/answer/FAQ style to... Read More
The major reason I recommend getting your hands on real... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
Are you one of those people that keeps track of... Read More
Using professional icons in your application or website can bring... Read More
This article will not attempt to advocate the use of... Read More
When you need a phone number, you do a quick... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
You've finally created databases that you can actually use to... Read More
I suggest that you do not spend a lot of... Read More
Software |