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
express cleaning service Arlington Heights ..You have gotten those E_Mails buy software at deep discounts.... Read More
Usually, the easiest way to tell you have spyware is... Read More
It's all about turn times in the eMedia industry! The... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Are you lost in the mess of documents that get... Read More
I suggest that you do not spend a lot of... Read More
I provide, here clear explanations and a count of function... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Not every software testing project can or should be automated.... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
There are two approaches for application integration:? Programmer's approach ?... Read More
If your company has regional and worldwide operations, you might... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
It's no secret that software companies operate in a very... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Each Industry and market niche has business specific and unique... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
You've finally created databases that you can actually use to... Read More
While Adobe is the most known maker of PDF tools,... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
It is possible that if one avoided all sources of... Read More
tidy up service Arlington Heights ..Great Plains Fixed Assets Management module is a robust tool... Read More
If you copy something from a Web site or elsewhere...... Read More
We'll give you non formal view, based on our consulting... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
The term "document management" and "paperless office" is the subject... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
The Windows Indexing Service provides you with the ability to... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
What is Groupware?Have you ever had to manage document collaboration... Read More
If you have Microsoft Great Plains and support it... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
The title of "software engineer" has got to be among... Read More
Do you want to get quality software at a reasonable... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
The adware and spyware definitions list is very long. But... Read More
Software development is a risky business.Many software developers are barely... Read More
MS CRM is very close to document workflow automation, including... Read More
1. With mapping software you can create a report that... Read More
FTP stands for "file transfer protocol". FTP is basically a... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Software |