Computer Programming: The Inspiration and an Introduction


Farmers' MarketThe path to success is not easy. It’s filled with hard work, late nights and early mornings. To become good at anything it takes time, dedication and desire. If we put this into perspective, every day we are presented with tasks and challenges that enables us to learn new things and find solutions to those problems. A perfect example is today’s modern world. In this day and age, information and communication is accessible to us with just one touch of our thumb. Our surroundings have become the internet of things and our phones have become our most cherished possessions. Once we access our digital objects, we are entering a world full of data and communication. But have you ever stopped to wonder why and how we are able to communicate with friends and family, listen to music, stream videos, or better yet, take selfies? For me, this was my enlightenment, my light bulb moment where computers became my interest. This newfound purpose motivated me to pursue a career in the science and engineering field.

My purpose for today is to inspire, help and share some information on how computers function. What I want to introduce to you is computer programming. Before I introduce you to a programming language, keep in mind that there are many programming languages that let us communicate and perform certain tasks with the computer, but are beyond this scope. I highly encourage you to research and learn as many languages as you can, because if you learn one language well enough then you’ll transition to another language more smoothly. You will also learn that each language has its own pros and cons. With that in mind, let’s get started with C++. C++ is a very powerful language that has influence languages such as C# (pronounced “see sharp”) and Java. This is the first language I learned, and I will help you get acquainted by writing your very first code in C++.  The skeleton or parts of a C++ always begin with the following:

//intro C++ program, this is also a comment

#include <iostream>

using namespace std;

int main()

{

            return 0;

}

Once we set up the skeleton of C++, we could begin to display output on the computer screen by using the cout object (cout) and the insertion operator (<<) to send output. The result will be a simple code known as “Hello World!”  All we need to do is type the following in between the curly braces ({}) onto the code above.

cout << “Hello World!” << endl;

The result should look like this

#include <iostream>

using namespace std;

int main()

{

            cout <<“Hello World”<<endl;

            return 0;

}

Congratulations, we have written our first C++ program where you learned how to set up the parts of a C++ program and display output on the screen. In the future, will continue adding pieces to the program and introduce other concepts as well.

Leave a comment

Your email address will not be published. Required fields are marked *