PROGRAM REQUIREMENTS 1. Declare and initialize an integer named length. You will use this integer variable to control the size and shape of animations later. You will get the value of this integer from the user. The user must enter an odd integer. If the user enters an even integer, you must let the user know that they need to enter an odd number and ask for the value again. You must keep on asking the value until the user enters an odd integer. See included video. 2. Declare an enumeration constant with values Square, Triangle, Pentagon, Sentence and Quit and assign integer values 1 to 5 to them respectively. 3. Generate a seeded random integer in the range of 33 to 64, inclusive. This integer is the ASCII value of the character that you will use to generate the animations.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PROGRAM REQUIREMENTS
1. Declare and initialize an integer named length. You will use this integer variable to control the
size and shape of animations later. You will get the value of this integer from the user. The user
must enter an odd integer. If the user enters an even integer, you must let the user know that
they need to enter an odd number and ask for the value again. You must keep on asking the value
until the user enters an odd integer. See included video.
2. Declare an enumeration constant with values Square, Triangle, Pentagon, Sentence and Quit and
assign integer values 1 to 5 to them respectively.
3. Generate a seeded random integer in the range of 33 to 64, inclusive. This integer is the ASCII
value of the character that you will use to generate the animations.
4. Inside a switch-case block with a default case, implement the following features.
• You must use the enumeration constants of Step 2 to set up your cases.
• You must use a variable of your enumeration constant type for switching control.
• Ask the user to choose the type of shape – Square, Triangle, Pentagon, Sentence and Quit.
o You must display the choices in the form of a menu. See included video.
o Use a suitable integer variable to get the choice from the user.
• If the user chooses to generate a Square
o Generate a square shape that starts at size 1 and progressively increases up to
size length. See the video in the link.
o To generate squares of different sizes, you will need to clear the screen and regenerate the square of appropriate size for each square. Note that you cannot go
back edit a line in the output, so every square you generate will be a new square.
To clear the screen use
system("clear");
o There must be sufficient delay between the squares of different sizes, otherwise
you will only see the last square.
To add delay use
#include <unistd.h>
sleep(1);
Note that this will only work on our CSE Linux Servers.
• If the user chooses to generate a Triangle
o Clear the screen
o Here length is the number of lines used to generate the triangular shape i.e.
height of the triangle.
o The triangular shape must be symmetric about the vertical axis. There must be
exactly one character in the first line, and the number of characters increases by
2 in every successive line. See included video.
o Make sure to add delay to view a progressively growing triangle, otherwise you
will just see the final triangle

 

please help me to use C++ 

Expert Solution
Step 1

According to the Bartleby guideline, we are supposed to answer only the first 3 questions at a time.

Kindly repost the remaining question and mentioned it

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education