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

move out cleaning service Glencoe ..
In The News:

Anonymous researcher has scraped public Spotify accounts of politicians and celebrities, highlighting major privacy risks in default platform settings.
AI chatbot toys marketed as screen-free playmates could undermine children's empathy and critical thinking skills, according to pediatric specialists.
TransUnion confirms a major data breach affecting 4.4 million U.S. consumers after hackers exploited third-party Salesforce apps to steal personal info.
Scammers use fake DocuSign emails claiming Apple Pay charges to steal personal information using fraudulent phone numbers and fake receipts.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Farmers Insurance confirms data breach affecting over 1.1 million customers nationwide, exposing customer info including addresses.
The iconic Mary Kay pink Cadillac goes electric with the Cadillac Optiq, available only to the company's top 1% of sales force performers.
Cybercriminals abuse trusted Intel driver to gain kernel access and shut down Windows Defender, enabling undetected malware deployment since July 2025.
Using email aliases for online shopping and subscriptions can protect your privacy by preventing companies from linking your activity across websites.
New research shows AI overlap does not equal job replacement, with knowledge-based roles seeing most integration while physical jobs remain least affected.
Scammers target seniors who avoid social media by exploiting public records like obituaries and real estate filings to steal personal information and money
Recovery team in Italy use AI-enabled drones to detect missing hiker's red helmet, leading to successful recovery after months of ground searches
Google Salesforce system breach exposes business data while scammers use incident to target users with fake security calls and phishing attempts.
Google announces Pixel 10 lineup with Tensor G5 chip and Gemini Nano AI, introducing Magic Cue, Pro Res Zoom up to 100x and satellite emergency support features.
C San Diego study reveals 86% of school safety companies monitor students 24/7 on personal devices, raising privacy concerns.
Users can now add their favorite outlets' coverage to the Top Stories section of Google search results by utilizing the 'preferred sources' feature. With just a few clicks, you can add Fox News.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Interstellar object 3I/ATLAS shows an unexpected frontal glow that Harvard's Avi Loeb says cannot be explained by sunlight reflection or standard cometary outgassing.
Receiving order confirmations for purchases you never made could mean your email address is being exploited in fraud operations targeting multiple retailers.
First wireless brain implant works with Apple's official protocol, enabling hands-free control of iPhones, iPads and Vision Pro through thought alone.
Data brokers sell personal details that scammers use to target retirement funds through fake financial advisor calls and convincing phishing attempts
Ten innovative tech solutions from gait sensors to smart pill dispensers help adults 65+ track fall risks and prevent injuries before they happen.
Meta AI internal documents revealed chatbots were allowed to flirt with children and engage in romantic conversations until the company was exposed by Reuters.
ChatGPT will avoid giving direct mental health advice under new OpenAI rules following instances where the AI model provided harmful or misleading responses.
Your phone tracks you in more ways than that little GPS icon suggests. Here’s how to find and clear hidden location logs on iPhone and Android.

10 Things You Could be Using Photoshop For, But Probably Arent

Most people don't use Photoshop to its fullest capabilities. Here... Read More

Lotus Notes Domino and Microsoft CRM Integration

Well, even if the combination might look very unusual, we... Read More

Antivirus Software ? Get The Bugs Before They Get You!

You turn on your computer, and it doesn't look quite... Read More

Great Plains Dynamics on Pervasive/Ctree support ? overview for consultant

All of us know that Microsoft bought former Great Plains... Read More

Great Plains Bill of Materials Setup & Customization for Process Manufacturing ? Overview

Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More

Microsoft Great Plains Accounting/ERP Implementation ? Finance Industry Customization Example

Microsoft Business Solutions Great Plains is very generic accounting application... Read More

Things You Can Do With Windows XP!

Did you ever give a thought to the number of... Read More

Microsoft Great Plains: Customization Upgrade & Recovery ? Visual Studio VB 6.0

Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More

Microsoft Great Plains Furniture & Fixtures ? Implementation & Customization Highlights

Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More

C++ Tutorial 1, Introduction to C++

Introduction to C++Why Learn C++?C++ may at first seem like... Read More

Great Plains Dexterity Programming ? Overview For Developer

Looks like Microsoft Great Plains becomes more and more popular,... Read More

Enterprise Resource Planning Overview

ERP (Enterprise Resource Planning) Overview covers What is ERP, Brief... Read More

C++ Tutorials: 3, Program Flow (If, Else, While, For)

Program Flow is what you think it is. How the... Read More

5 Mac Security Tips You Can?t Live Without

So, you've bought a new Macintosh, and now you may... Read More

.Net Charts and Graphs Interact with Businesses and Customers

Bar charts, bar graphs, and any other chart or graph... Read More

Great Plains Sales Order Processing and Invoicing Modules ? Tips For Consultants

We'll give you non formal view, based on our consulting... Read More

How To Develop Software For Your Business

Software development is a risky business.Many software developers are barely... Read More

Fast Car Knoppix

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

SQL scripts for Project Accounting: Microsoft Great Plains series ? overview for developer

Microsoft Business Solutions Great Plains has Project Accounting module where... Read More

Reporting Tools for Microsoft Great Plains ? Overview For Developers

Looks like Microsoft Great Plains becomes more and more popular,... Read More

Microsoft Axapta, Navision or Great Plains: ERP Selection for Large Corporation

If you would like to pick something from Microsoft, or... Read More

Ukraine IT Myths Dispersed

While Ukraine is becoming a new popular IT outsourcing destination,... Read More

Microsoft Great Plains Integration Manager: Using Continuum ? Overview for Developer

Microsoft Business Solutions Great Plains has I'd say end user... Read More

What is Spyware? Are You Being Watched?

Find out why Spyware Removal from computers is important and... Read More

Huddle Up; Groupware on Three

It could just be me, but my experiences with document... Read More

house cleaning company Bannockburn ..