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
Tinley Park executive chauffeured services .. Lockport Chicago limo O’HareDuring the years of our consulting practice, which comes back... Read More
ERP (Enterprise Resource Planning) Overview covers What is ERP, Brief... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
When you visit department stores and see that majority of... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
This short paper will expand on two key reasons to... Read More
In linux, one of great commands for finding out information... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Spyware and malware are large problems for Internet users today... Read More
Most people don't use Photoshop to its fullest capabilities. Here... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
There are certain pluses and minuses in both cases and... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More
Not all of us have the luxury of working both... Read More
With many manufacturing shops heading over seas in favor of... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
Imagine something that follows you home and sets itself up... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
limo Chicago Hickory Hills ..In this small article we will be looking at the... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
If you have been running Windows XP for a couple... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
Mike Dunville* had a decision to make. As the new... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
ERP Consulting industry is on the way to serve clients... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Learning how to program software seems like a daunting task... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
Accounts payable is just one area of office management where... Read More
The term "document management" and "paperless office" is the subject... Read More
Some companies that are in need of fleet management may... Read More
The purpose of one of our projects was MS Exchange... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
User interfaces and accessibility are some of the most important... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
The objective for Zandi Digital is to make available clever... Read More
Software |