Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ Lab Assignment 4 In this lab assignment, you will implement a simple console drawing program which implements a screen of a given size.
In C++
Lab Assignment 4 In this lab assignment, you will implement a simple console drawing program which implements a screen of a given size. The screen will hold boxes in a linked list in a given order. Your program should draw the filled boxes in the correct drawing order. The fill colours should be a to z. The program allows the user to change the order of the boxes and hence you must create functionality to modify your linked list 1. Create a source and a header file for the two classes screen and Box and name them screen.cpp, screen.h, box.h and box.cpp, respectively. A file main.cpp is supplied and your program must work with it without change. Make sure to use the names exactly as typed, otherwise the TAs may return the files to you. 2. The main routine will ask the user for a screen size and the number of boxes to draw. It then randomly generates the number of boxes and stores them in the screen. The fill colours for the boxes will cycle through a to z. The program than draws the boxes onto the screen and waits for user input. The user selects for which box to change its position in the drawing order by entering the current position of the box in the drawing order and then a positive number for bringing the box forward and a negative number for pushing it back is entered. If the user select the box -1, the program will exit. Note that the drawing order is from "oldest" box to "newest" box unless it the rank of a box has been changed. Example Width of screen: 40 Height of screen: 10 Number of boxes: 3 a-b- c Box to switch: 0 Change in position: 2 cCcCCCCCCCcccccCCC Lab Assignment 4 In this lab assignment, you will implement a simple console drawing program which implements a screen of a given size. The screen will hold boxes in a linked list in a given order. Your program should draw the filled boxes in the correct drawing order. The fill colours should be a to z. The program allows the user to change the order of the boxes and hence you must create functionality to modify your linked list 1. Create a source and a header file for the two classes screen and Box and name them screen.cpp, screen.h, box.h and box.cpp, respectively. A file main.cpp is supplied and your program must work with it without change. Make sure to use the names exactly as typed, otherwise the TAs may return the files to you. 2. The main routine will ask the user for a screen size and the number of boxes to draw. It then randomly generates the number of boxes and stores them in the screen. The fill colours for the boxes will cycle through a to z. The program than draws the boxes onto the screen and waits for user input. The user selects for which box to change its position in the drawing order by entering the current position of the box in the drawing order and then a positive number for bringing the box forward and a negative number for pushing it back is entered. If the user select the box -1, the program will exit. Note that the drawing order is from "oldest" box to "newest" box unless it the rank of a box has been changed. Example Width of screen: 40 Height of screen: 10 Number of boxes: 3 a-b- c Box to switch: 0 Change in position: 2 cCcCCCCCCCcccccCCCStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started