C++ Tutorial 2, Input and Variables

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

car service from Midway Burlington .. Lockport Chicago limo O’Hare
In The News:

Tech expert Kurt “CyberGuy" Knutsson says a malware app called SpyLend is posing as a financial tool, hitting 100,000-plus downloads.
Tech expert Kurt “CyberGuy" Knutsson says Clone Robotics’ Protoclone mimics humans with 1,000 muscles – too human for comfort.
Tech expert Kurt “CyberGuy" Knutsson urges you to use Apple’s App Privacy Report to see what your apps are really up to.
Tech expert Kurt “CyberGuy" Knutsson talks about how to smoothly transfer your data from an old laptop to a new one using cloud storage or external drives.
Kurt the CyberGuy offers tips to safeguard your personal information as scammers become more sophisticated with scam texts and other methods.
WeRide's unmanned electric delivery van, the Robovan W5, has 194 cubic feet of cargo space and can carry payloads up to about 2,205 pounds
Kurt the CyberGuy recommends deleting 16 browser extensions immediately in response to a report saying more than 3.2 million web users were affected by a security breach.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
A robotics firm in China claims a robot has performed the world's first humanoid robot front flip, which is significantly more difficult than a backflip.
A digital ID may be even more secure than a physical ID. Storing your driver's license in your Apple Wallet is an ideal solution for commuters.
A cybersecurity firm has shed some light on just how common tax scams have become. Kurt the CyberGuy offers his advice for how to protect your refund.
Lifesize Plans offers immersive walk-throughs that allow customers the opportunity to tour a home's design before construction actually begins.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
A man invested $4 million in bitcoin and lost it all with a single click when he was targeted by a vishing scam, which uses phone calls to trick people.
Expandable's Touchdown is a designer trailer that promises a luxury off-grid living experience and unfolds into a home in about 15 minutes.
Major employee screening company data breach affects 3.3 million people. Tech expert Kurt “CyberGuy" Knutsson explains what happened and gives five ways to protect your data.
Kurt “CyberGuy" Knutsson reveals mind-blowing tech that gives you sunlight on demand.
New malware "FrigidStealer" targets Mac computers. Tech expert Kurt “CyberGuy" Knutsson offers four ways to stay safe from infostealer malware.
Kurt “CyberGuy" Knutsson talks about how lab-grown muscles power a biohybrid hand for scalable prosthetics and research.
Reports of task scams have significantly risen in the past four years, according to the Federal Trade Commission. Kurt the CyberGuy offers some red flags.
iPhones have a hidden folder that eats up storage without you knowing it. Kurt the CyberGuy offers some tricks to free up storage on your device.
A recent ransomeware attack targeted Zacks, an American investment firm, and a cybercriminal claimed to have stolen records for millions of customers.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Researchers unveiled a new soft prosthetic hand that combines the natural coordination patterns of our fingers with the decoding of motoneuron activity in the spinal column.
Accidentally deleting a text message on your iPhone or iPad is not a problem if you still need the message. Apple has a built-in way to recover it.

Monitoring Software Can be Used for Spying as Well

We all already got used to computer monitoring both at... Read More

History of Java

The java programming language is becoming more and more popular... Read More

Dashboard Widgets for Windows

For a windows user like me, just can watch with... Read More

Navision Attain Database access via C/ODBC in ASP.NET Application

Navision Software was purchased by Microsoft and now it is... Read More

Benefits of Shareware

Shareware has been fighting the stigma of being misunderstood for... Read More

40/sec to 500/sec

IntroductionSurprised, by the title? well, this is a tour of... Read More

Dont Choose Adobe When Working With PDF

While Adobe is the most known maker of PDF tools,... Read More

Best Spyware Removers

Finding the best spyware removers to detect and remove spyware... Read More

Microsoft CRM Customization: Integration with Third Party SQL Application/Database

Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More

The Secret of the Layer Styles Dialogue

When you double-click a layer in the Layer Palette, you... Read More

Great Plains Accounting Migration to Microsoft Great Plains - Overview for IT Specialist

This is a short article, written in question/answer/FAQ style to... Read More

Microsoft Great Plains - Microsoft RMS Integration ? overview

Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More

IT Strategy for Midsize Business: Microsoft vs. Java, Great Plains & CRM

Midsize business or non-profit organization should decide if one-vendor solution... Read More

Microsoft Great Plains: Annual Enhancement Program ? How To Be Re-Enrolled

Microsoft Business Solutions Great Plains is mid and even corporate... Read More

Microsoft Great Plains & CRM in Transportation & Logistics ? Overview

Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More

My Experience - Making a Vision into Reality

Disclaimer: All the thoughts expressed are my views only! Your... Read More

Groupware: What Works the Way Businesses Do?

GroupwareThe internet is full of 1.5 million to 7 million... Read More

Recent Studies Show that 9 out of 10 PCs Are Infected with Spyware

Spyware and malware are large problems for Internet users today... Read More

Put Some Pizazz in Your Software Arsenal

The software giants don't do everything and don't always produce... Read More

Did You Ever Want to Completely Erase Everything on Your Computer?

Did you ever want to erase everything on your computer?... Read More

Brief Notes About Mainframe Software Pricing

We don't think about mainframe software pricing anymore, we just... Read More

New SQL Delta Version 3.1

COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More

IBM Lotus Domino or Microsoft Exchange?

IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More

SSH (SCP) Send Files from Windows to Your Linux Box

Not all of us have the luxury of working both... Read More

Microsoft Great Plains Implementation for Midsize & Large Corporation: Lockbox Processing

Microsoft Great Plains is now targeting large and midsize businesses... Read More

Granger limo Chicago ..