Answered step by step
Verified Expert Solution
Link Copied!

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++

image text in transcribedimage text in transcribed

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 cCcCCCCCCCcccccCCC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

Proficiency with Microsoft Word, Excel, PowerPoint

Answered: 1 week ago

Question

Experience with SharePoint and/or Microsoft Project desirable

Answered: 1 week ago