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
maide service in Park Ridge ..Microsoft CRM customization techniques are very diversified and based on... Read More
It's no secret that software companies operate in a very... Read More
NOTE: Please take time to read on - it may... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
Document Manager and Version HistoryIn previous articles I have discussed... Read More
This is the tutorial where we really get into programming.... Read More
The Internet is reshaping every form of communications medium, and... Read More
We would like to give you pluses and minuses of... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
Most people understand that the "hardware" part of their computer... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Are you a whiz at calculating financial information? Not the... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions.The whole... Read More
Using professional icons in your application or website can bring... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
In part III of this ISDN primer, we learned that... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
I have yet to see a business that, sometimes in... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
Whether you need to close a sale, gather end-user feedback,... Read More
Sometimes your PC will start acting strange for no apparent... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
XML Server can be a Web Server that stores the... Read More
It could just be me, but my experiences with document... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
after renovation cleaning Highland Park ..Microsoft Word is one of the most popular office applications... Read More
The purpose of Project Management Software is to provide an... Read More
When it comes to screenplay software each screenwriter needs to... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
Executive SummaryAn effective plan for entering, cleaning and updating the... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Disclaimer: All the thoughts expressed are my views only! Your... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
In the previous ISDN article, we looked at how and... Read More
It is now common thing when large corporation selects mid-market... Read More
The research in the field of Natural Language Processing usually... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Not all of us have the luxury of working both... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
The world of small business accounting software can be a... Read More
1. With mapping software you can create a report that... Read More
Microsoft Business Solutions products: Great Plains, MS CRM, Navision, Axapta,... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
With many manufacturing shops heading over seas in favor of... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Spyware is software or hardware installed on a computer without... Read More
Once upon a time not so long ago, there was... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Software |