Using if, else, string, and char Recap | C++

Using if, else, string, and char Recap | C++

In the last several tutorials we covered a lot of information quickly. In this tutorial we will recap a variety of the components that we have learned so far.

We will create a program that will input and output a string variable.  We will use an if statement to determine what data to output to the user.  This is a neat tutorial to quickly recap the information that we have learned so far.

(more…)

Creating and Using Functions | C++

Creating and Using Functions | C++

Functions are useful in a variety of programming applications.  On the basic level, functions allow us to send values to functions, which then preform computations and return a value.  In our previous tutorials we have become familiar with the main() function.  In this tutorial we will learn the basics of using functions by creating a small program that uses a function to compute sales tax.

(more…)

do while Loops | C++

do while Loops | C++

In the last two tutorials we talked about the for loop and the while loop.  Both of these require a condition to be met to run a set of statements.  In some circumstances you may want to run a statement at least once even if a condition is not met.  For those circumstances we can use a do while loop.  The do while runs through the statements once and then checks the condition.

(more…)

while Loops | C++

while Loops | C++

In the last tutorial we learned about for loops.  In this tutorial we review while loops.  While loops are very simple loops.  They loop while a condition (ex: x > 11) is met.  One major difference between for loops and while loops is that while loops do not declare or update the variable.

(more…)

for Loops | C++

for Loops | C++

Loops are useful in a variety of applications.  For loops are very helpful and used frequently.  There are three main components to a for loop: variable initialization, condition, variable update.

The basic construct to use a for loop is the following:  for(variable initialization, condition, variable update) {  }

In the video and source code below we will go more in depth into understating this.

(more…)

Intro to If Statements | C++

Intro to If Statements | C++

We are making some good progress into the framework on how programs store data and preform simple calculations.  Now lets introduce a way that our programs can make logical decisions based on conditions.

What is a condition?  A simple example is if is greater than a value, then perform and action.

(more…)

Pin It on Pinterest