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
shuttle to Midway Beardstown .. Lockport Chicago limo O’HareLooks like Microsoft Great Plains becomes more and more popular,... Read More
Not every software testing project can or should be automated.... Read More
Using professional icons in your application or website can bring... Read More
Many Webmasters have never bothered to view their website's server... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
It's no secret that software companies operate in a very... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
Since technology changes so quickly, it is hard to begin... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
Handling character strings in Java is supported through two final... Read More
If you are to buy a HelpDesk & Asset Management... Read More
Upgrading. Downtime. Maintenance. Hardware obsolescence. Implementation issues. The litany of... Read More
You might think you don't need a firewall... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Stealing company information used to be the specialty of spies... Read More
The objective for Zandi Digital is to make available clever... Read More
In order to implement VLANs in a network environment, you'll... Read More
We were recently faced with a decision: either to let... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More
Enabling Chinese input is quick and easy, there are only... Read More
As we could imagine, if you are reading this article... Read More
Green Bay Hummer H2 SUV rentals ..Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Introduction To ISDN, Part III: Configuring PPP PAP AuthenticationNow we... Read More
Did you ever give a thought to the number of... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
In order to implement VLANs in a network environment, you'll... Read More
An integral part of any quality CRM system is lead... Read More
Whether you are a small consultancy firm, a medium sized... Read More
There are several kinds of software piracy. The bottom line... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
With any good luck and a good amount of hard... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Some companies that are in need of fleet management may... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
The purpose of Project Management Software is to provide an... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
We are in a transition phase in the Managerial Administration... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
What is installation in the language of technology? Installation... Read More
Icons are used everywhere; right from software applications, to internet... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Software |