Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement in C++ and show output as well Thanks ! Software Requirements (what to do) The second assignment will use a variety of C++ syntax

Implement in C++ and show output as well
Thanks ! image text in transcribed
Software Requirements (what to do) The second assignment will use a variety of C++ syntax and control flow stuctures (e.g. loops, switch statements, functions, const int variables, structs, the standard library, enums, array, etc.) to create a pattern drawing application. Users will be able to select a shape to draw that will be printed out to standard output using std::cout. This application will draw a fixed size 10x10 pattern. The patterns your application will support are: filled, striped, checkered, a square, an x and an upper.right triangle. Your C++ application code must have the following components. 1. A file called A02.cpp with a main(...) function and the comments shown below with your name, student id, and submission date: // Name: YOUR FIRST&LAST NAME / SSID:YOUR STUDENT ID // Assignment #: ASSIGNMENT.2 / Submission Date: DATE YOU SUBMIT // Description of program: ....your code goes here 2. An enum Shapes describing the patterns to draw and an enum Colors with colors black & white. enum class Shapes FILLED,STRIPES, CHECKERBOARD,SQUARE, X, UPPER TRI) enum class Colors BLACK, WHITE 3. A struct type called Pixel with a single enum Colors data member struct Pixel Colors color; 4. An array of Pixel structs to create a pixel buffer 5WIDTH and HEIGHT integer constants of the pattern. To create, use either #define or const int at global scope. These can be used to initialize the Pixel array described in step 4 6. At least two functions with the following prototypes: void CreateShape Pixel p[), int nPixels, Shapes shape void Drau Pixel p[], int nPixels Where p is an array of Pixel structs, nPixels is the number of pixels in the pattern (in our case 10x10): and shape is a Shapes enum. 7. The CreateShape(...) function will set the colors in the Pixel array. For example, if the filled 8. The Draw(..) function will output 'Ill, for a pixel that is Colors ::WHITE or three spaces for 9. The program will have a loop driven menu system to ask a user which shape to draw and q to exit. pattern has been selected by the user, then all the pixel colors will be set to Colors::BLACK a pixel color that is Colors:BLACK See the example output provided in this handout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions