Where were we?

--Originally published at prgrm.co

Fun with numbers A.K.A WSQ 01.

Something I didn’t mention in the post before this one, is how the “self-grading” works. For what I understand we need to cover a variety of mastery topics. I’ll go nuts and try tackling as much of them as I can in this post.

Mastery Topic 1: Use of comments.

Well isn’t this one real easy? There are two ways of commenting in c++:

  1. Single-line comments: add // before each line.
  2. Multi-line comments: /* your interesting text here */

Why comment? Well, when doing more complex programs, a comment is always a helpful reminder of what’s doing what.

Mastery Topic 2: C++ Good Style coding conventions

So everyone has a different way to understand and process things, so there is no “actual” way to code, but there are a couple of guidelines that I think is important to follow.

  1. Name your variables in a way that make sense
  2. Watch out for those brackets, you don’t want to loose them or get them mixed up, use your TAB key wisely.

You’ll see what I’m talking about in the code below.

Mastery Topic 3: Basic types and uses

There are different types of variables:captura-de-pantalla-2017-01-24-a-las-12-20-02-p-m

Link for the picture.

Mastery Topic 4: Basic Output.

This one is an easy one as well, you will need this for almost all your programs

  1. Write this at the beginning of your code #include <iostream>, this includes the library in which cout is.
  2. Write this as well include namespace std; this will save you time during your whole project.
  3. Then simply write: cout << ” Your interesting text here “.

Mastery Topic 5: Basic Input.

This is really important but easy as well, it is important because that’s how you’ll ask the user to insert data.

  1. You need to be able to declare your variables prior to
    captura-de-pantalla-2017-01-24-a-las-12-27-20-p-m
    captura-de-pantalla-2017-01-24-a-las-12-31-21-p-m
    Continue reading "Where were we?"