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
post construction cleaning Deerfield ..I have always regretted how Microsoft price gouges and rips... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
When you double-click a layer in the Layer Palette, you... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
C++ Function templates are those functions which can handle different... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
Microsoft Office program is a programming tool called Visual Basic... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
For those who are unclear on the differences between the... Read More
There are several kinds of software piracy. The bottom line... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
Microsoft Word is one of the most popular office applications... Read More
Now is the time to look at an alternative to... Read More
Words we choose to describe things and phenomena often show... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
Mike Dunville* had a decision to make. As the new... Read More
Viruses and spyware usually show up on your computer one... Read More
I suggest that you do not spend a lot of... Read More
Whether you need to close a sale, gather end-user feedback,... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Airbnb cleaning service Bannockburn ..Spyware, what it is and what it does. Basically, spyware... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Most people understand that the "hardware" part of their computer... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
All your software is stored on a hard-drive. But how... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
Let's first look at your ERP system selection (without Retail... Read More
The Windows Indexing Service provides you with the ability to... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Customer Relationship Management or CRM is a combination of enterprise... Read More
1. With mapping software you can create a report that... Read More
Microsoft Great Plains, Navision, Solomon and Axapta are Microsoft Business... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
Looks like Microsoft Great Plains becomes more... Read More
Microsoft Great Plains is main Microsoft Business Solutions product, targeted... Read More
When Windows fails to boot it is normally caused by... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
If you look back to the history, you will see... Read More
Looking at all the ads which promise to get rid... Read More
We all take the computer for granted. I mean, all... Read More
You turn on your computer, and it doesn't look quite... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Software |