Part 1 of C++ Workshop

(Draft Still Under Construction)

EXERCISE. Hour of Code.

To be done before the Workshop. This exercise was included in email sent to you last week. It is a fun way to get familiar with what coding is all about.

Objective. To become comfortable with the way computers think and with the logic they use.

What to do. Go to http://studio.code.org/hoc/1

EXERCISE. Hello, World!

Objective. This is just an exercise to get comfortable with the C++ software we will use.

What to do. Not a programming assignment. Step-by-step instructions with screenshots.

NOTE: You will create a folder on the desktop to save your work. Then you can save to a thumb drive, email it to yourself, or upload to your own cloud service (e.g., Google Drive) so you don’t lose it. If you do not have a C++ compiler of your own – yet – you can always show off your programs in a browser, using, e.g., C++ Shell at http://cpp.sh or the REPL environment at http://repl.it

Digression – Let’s learn about computer code and compilers

PROGRAM. Hello, World – It’s me!

Objective. To learn about output.

What to do. Modify the “Hello World” program you used (above). Add more to the output, for example:

Hello, World! It’s me, Adele!

Put whatever you like in the output and watch it grow. You have written your first program!!

PROGRAM. Art – Draw a Face

Objective. To learn about fun ways to use program output.

What to do. Write a C++ program that displays a drawing of a face in the console window. Use this one and then try to make up your own drawing.

/////

+-----+

(| o o |)

| ^ |

| --- |

+-----+

Source: Cay Horstmann, C++ for Everyone, Wiley

PROGRAM. Art – Draw a House

Objective. To learn about fun ways to use program output.

What to do. Write a C++ program that displays a drawing of a house in the console window. Use this one and then try to make up your own drawing.

/\

/ \

+----+

| |

| .-.|

| | ||

+----+

Source: Cay Horstmann, C++ for Everyone, Wiley

PROGRAM. Art – LARGE CAPS

Objective. To learn about fun ways to use program output.

What to do. Write a C++ program that displays a LARGE capital letter, composed either of asterisks (*) or of the letter itself. For example:

* *

* *

*****

* *

* *

Or

H H

H H

HHHHH

H H

H H

PROGRAM. Art – Make a Banner

Objective. To learn about fun ways to use program output.

What to do. Write a C++ program that displays a short message built with large capital letters such as the ones in the previous program.