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
eco-friendly cleaning service Buffalo Grove ..Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
A wiki is an editable text-based website. But you don't... Read More
In the previous ISDN article, we looked at how and... Read More
In this short FAQ style article we would like to... Read More
First we had the original Google search that evolved into... Read More
To all web designers out there, this article is for... Read More
Great Plains Integration Manager scripting and translation - overview for... Read More
Each Industry and market niche has business specific and unique... Read More
During the years of our consulting practice, which comes back... Read More
We were recently faced with a decision: either to let... Read More
The research in the field of Natural Language Processing usually... Read More
Currently Microsoft Business Solutions is on the way of creating... Read More
If you company is small or mid-size special products or... Read More
Is your PC is slow and wimpy? Then you need... Read More
Great Plains Purchase Order Processing (POP) module makes up one-third... Read More
Did you ever give a thought to the number of... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
I completed an experiment recently. I wanted to find out... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
It could just be me, but my experiences with document... Read More
Upgrading. Downtime. Maintenance. Hardware obsolescence. Implementation issues. The litany of... Read More
What is IRC?IRC is Internet Relay Chat. It is a... Read More
Usually workflow & messaging is realized in CRM and then... Read More
If you are in the market for new staffing software,... Read More
Just the thought of a duel-boot scares many people away,... Read More
express cleaning service Arlington Heights ..It's no secret that software companies operate in a very... Read More
Spyware and malware are large problems for Internet users today... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
Linux essentials:It's free for download but you have to pay... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
When Windows fails to boot it is normally caused by... Read More
Microsoft Business Solutions is now in process of creating so... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
When Great Plains Software was designing and developing Great Plains... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Domino server is a buffer between the operation system and... Read More
Looking at all the ads which promise to get rid... Read More
Research bears that less than 70 percent of development projects... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Customer Relationship Management or CRM is a combination of enterprise... Read More
How to delete the user? This is the first problem... Read More
It is a well known fact that Java as a... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
Software |