Pages

Thursday, 10 September 2020

Chapter 16 // Exercise 5 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2017 and modified versions of the graphics files used throughout the chapters. You can find those versions through the link below.

Chapter 16 // Exercise 5

Write a program that draws a shape of your choice and moves it to a new point each time you click "Next". The new point should be determined by a co-ordinate pair read from an input stream.

Github: https://github.com/l-paz91/principles-practice/tree/master/Chapter%2016/Exercise%205


Another straightforward one. I added a next button & action function to the window created in the previous exercise and had it draw a randomly sized/shaped/coloured star. If no co-ordinates are given, it chooses a random one. In In_box::get_int(), it always returns -999999 if no number is given so I plugged that in as no number given.


Chapter 16 // Exercise 5 - Principles & Practice Using C++

No comments:

Post a Comment