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
disinfecting cleaning services Winnetka ..The US House of Representatives has recently passed the "Spy... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
Need software to record your voice, streaming audio or musical... Read More
If you company is small or mid-size special products or... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
Mike Dunville* had a decision to make. As the new... Read More
There are many commands that are used in linux on... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
2005 ? Back to the Future.What does the future hold?... Read More
Looking at all the ads which promise to get rid... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
Usually workflow & messaging is realized in CRM and then... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
If you have been running Windows XP for a couple... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
It is now common thing when large corporation selects mid-market... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
Ok... Where to start?Well, I guess I will start at... Read More
Is your PC is slow and wimpy? Then you need... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
Today's business world is fast-paced. No matter what it is... Read More
last minute cleaning help Highland Park ..Now that spyware is the single most dangerous threat to... Read More
During the years of our consulting practice, which comes back... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
Microsoft Great Plains, designed back in 1990th as database transferable... Read More
Once a business idea is selected, it is highly recommended... Read More
Linux essentials:It's free for download but you have to pay... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
Now there are Three Steps To Heaven Just listen and... Read More
This is the tutorial where we really get into programming.... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
If you feel intimidated when someone tries to teach you... Read More
There is many things more frustrating than surfing a website... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
After seeing many people complain about their weak Internet security... Read More
People often ask me: What image file formats will Photoshop... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Does Microsoft care for WebmastersIt's always been a problem with... Read More
The java programming language is becoming more and more popular... Read More
Microsoft Business Solutions is emerging as very attractive vendor for... Read More
Software |