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
bathroom cleaning service Northbrook ..We would like to give you several situations, when you... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Research bears that less than 70 percent of development projects... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
It???s easy to understand why you might be drawn to... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
Microsoft CRM is new player on the CRM software... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
The objective for Zandi Digital is to make available clever... Read More
Costs of fleet maintenance software can vary widely. It is... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
The Windows Indexing Service provides you with the ability to... Read More
At the end of XX century, in the late 1990th... Read More
When Great Plains Software was designing and developing Great Plains... Read More
When you own a small business, time is money. And... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
We live in a post-industrial age where information is the... Read More
insured cleaning company Wilmette ..With thousands of web pages added to the Net every... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Since technology changes so quickly, it is hard to begin... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Spyware and malware are large problems for Internet users today... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Microsoft Great Plains serves majority of US based horizontal and... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
Every day millions of new web documents emerge on the... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
Need software to record your voice, streaming audio or musical... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
Whether you have used Microsoft Word for years, have just... Read More
You turn on your computer, and it doesn't look quite... Read More
In a previous article, I wrote about OpenOffice... Read More
Which Type of Shop Can Rely On A Home Built... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
The vast majority of us will have, at some point,... Read More
I have yet to see a business that, sometimes in... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
We all take the computer for granted. I mean, all... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
Software |