Question: Homework++Assignment+2 CSCE 1030: Homework Assignment 2 Due: 11:59 PM on Sunday, February 24, 2019 PROGRAM DESCRIPTION In this assignment, we will move an object across
Homework++Assignment+2 CSCE 1030: Homework Assignment 2 Due: 11:59 PM on Sunday, February 24, 2019 PROGRAM DESCRIPTION In this assignment, we will move an object across the screen in a vertical dircction one now at a time, or in a horizontal direction one column at a time The object looks as follows: The height of the objoct (number of lines, five in this figure) as well as the diroction of the movement will be determined by the user. Youa should use the character to generale the object as well as make it symmetrical about the center as shown in the figure. Note that to make the object symmctrical we must have an odd number of characters in cach linc. To simulate the movement across the screen, you will have display the object, clear the screen and then display the object again in a loop. Use the following code snippet to clear the scrocn sleep (1): //wait for one second before clearing cout header file to make this work PROGRAM REQUIREMENTS: As with all projects in this course, your program's output will display your name, your EUID, your e-mail address, the department name, and course number. This means that your program will print this information to the terminal (see the sample output). . Declare an enumeration type with constant values HORIZONTAL and VERTICAL Assign suitable characters to the constant so that you can use them in a switch-case block later in the code. Define a C++ integer constant to store the number of times you want to move the object in either direction, and initialize it with a value between 10 and 20, your choice. . . Declare an integer variable to store the height (number of lines) of the objoct. Using a suitable message, prompt the user for the height. . Using suitable loops, generate the required text object and store the shape in a suitable string variable. Note that your loop should generate the object for any user spocified height HINT:Display your string afler generating the object to verify before attempting to move it Your program mast use a swilch-case block with cases that moves the object vartically or horizontally, Include a default c . case for wrong direction as well. This switch-case block mast be based on a character variable associated with you You must prompt the user for the value of the character variable with suitable message After the movement has completed, your program must ask the user if the us wans to restart the movement. If the user enters Y or y',your program must repeat execution ie. prompt the user for height and direction of movement, generate the object and move it .If the user enters anything else, terminate the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
