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
tidy up service Northbrook ..Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
Microsoft Word is one of the most popular office applications... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
The Windows Indexing Service provides you with the ability to... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
Introduction: The creating of a computer program involves a number... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
One day, you suddenly realize that your computer started to... Read More
Microsoft Retail Management System serves retail single store as well... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
There are many commands that are used in linux on... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
In linux, one of great commands for finding out information... Read More
I have recently created my first Php program. I wanted... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
We all already got used to computer monitoring both at... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
Navision Software was purchased by Microsoft and now it is... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
reliable home cleaners Buffalo Grove ..Microsoft Business Solutions CRM is present several years on the... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
As seeing large number of implementations ? in our case... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
One of the things we can be as certain of... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
1. With mapping software you can create a report that... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
Considering whether or not your software company should hire a... Read More
The Windows registry is a huge database that ensures normal... Read More
There are two approaches for application integration:? Programmer's approach ?... Read More
Now that spyware is the single most dangerous threat to... Read More
Whether you are an experienced web programmer or a complete... Read More
Many reasons made GBM a unanimous choice for experts, one... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
How many steps does it take you to locate and... Read More
IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More
It's no secret that software companies operate in a very... Read More
What is Software?Software is a set of instruction written to... Read More
The cornerstone of successful automated office systems is the ability... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
Software |