Learning C++

Introduction

In 2010, at 47 years of age and a moment of insanity according to my wife, I enrolled in the Batchelor of Engineering Technology degree at the Wellington Institute of Technology. A part of this course was computing which included some C++ programming.

It had been a very long time since I had written any code and I had never written anything in C++. Nonetheless, I managed to dredge up some knowledge and after some research, it became reasonably easy to write the code for my assignments.

I have included these on my site to assist students with learning some of the basics. A piece of advice to students, don't just cut and paste - there is no learning in that and it wont help you with exams. All the code provided on this site is my own work.

I used the Bloodshed Dev-C++ compiler version 4.9.9.2 to compile the code. Refer to www.bloodshed.net for details.

There are lots of resources on the net to help you learn C++.

All of these programs are console based. You can click on the links below to view the code in the frame below. Alternatively, if you are having problems with the frame, you can right click on the link and save the document to your computer. The following pieces of code are available:

The Code

  • Hello Hello World -- Program to print "Hello World" on the screen.
  • Stars Print Stars -- Program prints a box, oval, arrow and diamond using stars.
  • Pound Pounds to Kilos -- Program to convert pounds to kilos.
  • UpNames Uppercase Reverse -- Program takes names input from the keyboard and converts the letters to uppercase and prints the names in reverse.
  • Multiply Multiplication -- Program prints multiplication tables based on input from the user.
  • OddEven Odd/Even Integers -- Program produces odd or even numbers between two numbers input from the keyboard. It demonstrates two methods for achieving the same result.
  • Temperature Temperature -- Program converts Fahrenheit to Celsius based on user input.
  • VertNames Vertical Names -- Program takes a 4 digit number (input) and displays each digit vertically with the use of arithmetic operators, control structures and functions.
  • Grades Student Grades -- Program reads course marks and prints out grades for that mark.
  • Ascii Print Ascii -- Program prints a table listing of the ASCII characters and their corresponding codes specifically applying the static_cast function.

Learning C++ - The Code

If you cannot view the document in the frame, you can right-click on the desired link above and save the file to your computer.

Return to Home Page


Page Views: 2217


I would love to hear from you. If you have thoughts about the site, suggestions for projects, tools or apps, please drop me a line using the Contact Page.