Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAM DESCRIPTION: In this assignment, we will move an obiect across the screen in a vertical direction one row at a time, or in a

image text in transcribed

image text in transcribed

PROGRAM DESCRIPTION: In this assignment, we will move an obiect across the screen in a vertical direction one row at a time, or in a horizontal direction one column at a time. The obiect looks a s follows: The height of the object (number of lines, five in this figure) as well as the direction of the movement will be determined by the user. You should use the * character to generate the object as well as make it symmetrical about the center as shown in the figure. Note that to make the object symmetrical we must have an odd number of*characters in each line 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 screen: sleep (1) //wait for one second before clearing cout header file to make this work. PROGRAM REQUIREMENTS: . As with all projects in this course, yor program's output will display your name, your EUID, your e-mail address, the department name, and course mumber. 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 either direction, and initialize it with a value between 10 and 20, your choice. suitable message, prompt the user for the height. Define a C++integer constant to store the number of times you want to move the object in Declare an integer variable to store the height (number of lines) of the object. Using a . Using sitable loops, generate the required text object and store the shape in a suitable string variable. Note that yor loop should generate the object for any user specified height. HINT: Display your string after generating the object to verify before attempting to move it .Your program must use a switch-case block with cases that moves the object vertically or horizontally. Include a default case for wrong direction as well. This switch-case block must be based on a character variable associated with your enumeration constant. 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 user wants to restart the movement. 'If the user entersY' or 'y', your program must repeat execution i.e. prompt the user for height and direction of movement, generate the object and move it. 'If the user enters anything else, terminate the program Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description) comments for each variable, and commented blocks of code. This means, that in addition to the program printing your information to the terminal, it will also appear in the code in the comments as well Your program source code should be named "euidHW2.cpp, without the quotes where euid should be replaced by your EUID .Your program will be graded based largely on whether it works corTectly on the CSE machines (e.g., cse0, cse02, .., cse06), so you should make sure that your program compiles and runs on a CSE machine. This is an individual programming assignment that must be the sole work of the individual student. Any instance of academic dishonesty will result in a grade of F" for the course, along with a report filed into the Academic Integrity Database DESIGN (ALGORITHNM) On a piece of paper (or word processor), write down the algorithm, or sequence of steps, that you will use to solve the problem. You may think of this as a Tecipe" for someone else to follow Continue to refine your "recipe" until it is clear and deterministically solves the problem Be sure to include the steps for prompting for input, performing calculations, and displaying output. You should attempt to solve the problem by hand first (using a calculator as needed) to work out what the answer should be for a few sets of inputs Type these steps and calculations into a document (i.e., Word, text, or PDF) that will be submitted along with your source code. Note that if you do any work by hand, images (such as pictures) may be used, but they must be clear and easily readable. This document shall contain both the algorithm and any supporting hand-calculations you used in verifying your results

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 2 Lnai 9285

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Joao Gama ,Alipio Jorge ,Carlos Soares

1st Edition

3319235249, 978-3319235240

More Books

Students also viewed these Databases questions

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago