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

Riverside Chicago charter limousine .. Lockport Chicago limo O’Hare
In The News:

NASA's Ingenuity helicopter, which flew on Mars in April 2021, became the first aircraft to achieve powered, controlled flight on a planet other than Earth.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Thieves who have iPhones can usually detect a hidden AirTag in vehicles they are attempting to steal, and an RFID wallet may not help you.
Genmoji, the latest addition to Apple's Apple Intelligence suite, uses artificial intelligence to generate customized emoji based on text descriptions.
It's easy to find yourself swamped in unread emails. Here are a few simple steps to archiving them and clearing out some of your digital clutter.
Keep your retirement plan safe from data brokers selling your personal information. Kurt the CyberGuy explains how to protect yourself and your retirement.
Turo faces scrutiny after tragic incidents involving rented vehicles, raising questions about security measures and regulatory frameworks.
A Chinese company has developed a spherical, 276-pound law enforcement robot that has been chasing down criminals at impressive speeds.
Here are some powerful online sleuthing tricks you can use to check the credibility of a website, see old pictures of places you've lived and even learn more about your neighbors.
Beware scam calls: Avoid unknown numbers and protect your personal information. Tech expert Kurt “CyberGuy" Knutsson talks about the increasingly common scam.
Tech expert Kurt “CyberGuy" Knutsson helps you crush your New Year's goals with these 12 apps to help you stay on track and succeed.
There are many untapped safeguards and tips you can learn to take your Wi-Fi knowledge to the next level, technology expert Kim Komando shares her tricks.
VPNs ensure privacy; antivirus stops malware. Tech expert Kurt “CyberGuy" Knutsson says both are essential for online security.
Tech expert Kurt “CyberGuy" Knutsson cites a new report that says many people still use weak passwords like "123456," risking their accounts.
Tech expert Kurt “CyberGuy" Knutsson says a tech support scam used a fake Windows Defender pop-up, tricking the victim to call and download software.
Tech expert Kurt “CyberGuy" Knutsson reveals ways to restore accidentally deleted text messages on your Android phone.
A new study says outdoor security camera apps are among the biggest collectors of user data, including phone numbers, payment details and precise location.
In iOS 18.2 and later, Apple's Mail app enhances email management by automatically sorting messages into distinct categories to help find emails faster.
A virtual private network (VPN) allows computer and smartphone users to mask an IP and create a secure, encrypted connection between a device and the internet.
Android 15's latest feature, Private Space, is like a private vault helping to keep your personal or sensitive apps away from prying eyes.
Cybercriminals have more ways than ever to target teenagers; here are some of the most widespread scams and tricks to watch in order to keep your loved ones safe.
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 humanoid robot named CUE6 has got game. The basketball-playing robot, produced by Toyota, claimed a Guinness World Record for longest shot.
With electronic signatures becoming more common, Kurt the CyberGuy explains how to produce your digital John Hancock for online documents.
Kurt the CyberGuy walks through steps he recommends immediately taking after getting new electronics — like phones or TVs — as gifts this holiday season.

ERP Remote Support: Microsoft Great Plains Analysis ? Pluses & Minuses

Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More

XML Parser and Their Types

XML parser is a software module to read documents and... Read More

Exactly What Does FTP Stand for and What Can it do for Me?

FTP stands for "file transfer protocol". FTP is basically a... Read More

Microsoft CRM Customization - Processing In/Out-Going Email Messages

We would like to give you several situations, when you... Read More

The XP Firewall Isnt Enough

You might think you don't need a firewall... Read More

Microsoft CRM Integration with IBM Lotus Notes Domino ? Machinery Dealership Example

IBM Lotus Notes with Domino email server is traditional document... Read More

How to Evaluate Staffing Software

If you are in the market for new staffing software,... Read More

Great Plains Dynamics/eEnterprise Upgrade ? Things to Consider and FAQ

If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier)... Read More

Microsoft Great Plains Implementation ? Overview for IT Director/Controller

What is installation in the language of technology? Installation... Read More

Microsoft CRM Lotus Notes Domino Connector FAQ

Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More

Business Plan Software Review: Ultimate Business Planner?

One of the main reasons business owners and entrepreneurs use... Read More

5 Time-Saving Tips in Microsoft Word

Whether you have used Microsoft Word for years, have just... Read More

These Items Are A Must Before Making The Decision To Purchase Any Off-The-Shelf Software

1. What determines the software price? Is it Per Seat... Read More

Top Questions to Ask Before Buying a Help Desk & Asset Management Software

#5 All your hardware components like Printers, PCs etc come... Read More

Fast Car Knoppix

Small can be beautiful! Working with Knoppix for the past... Read More

The Dreaded Paper Label - Should it be Used?

While paper labeling CDs and DVDs may appear to be... Read More

Software For Your Hard-Drive

All your software is stored on a hard-drive. But how... Read More

Choose your Java Wisely

Java has come along a long way. Many would agree... Read More

Microsoft CRM Customization

Microsoft CRM customization techniques are very diversified and based on... Read More

Does Microsoft have any real competition?

Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More

Crystal Reports - Geterogeneus databases: SQL Server, Oracle, Unidata, Btrieve ? Tips For Developer

Crystal Reports is the most flexible tool on the market... Read More

Microsoft CRM Implementation ? Fundamental CRM Principles Revision

Microsoft CRM is relatively new player on the now becoming... Read More

Microsoft Great Plains: Getting New Users Licenses ? Annual Service Plan FAQ

Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More

40/sec to 500/sec

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

Software Tools To Help Your Business Sell More

Sales are all about leverage, because there is only so... Read More

Lincoln Stretch rentals Lake Villa ..