Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I would really appreciate it if you could provide the answers with a written code in IDE over the starter code provided: Program 1: ASCII

I would really appreciate it if you could provide the answers with a written code in IDE over the starter code provided:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Program 1: ASCII Flowers Due: Friday 01/27 1 Introduction On Blackboard, in the same folder where you found this document, there is some starter code called main.cc. For this assignment, you will add your own code to this file and then submit main.cc with your changes. Do not add any new files because they will not be used for grading. 2 How to Submit Your Work All your work will be done in a single file called main.cc, and you will submit this to Gradescope under the assignment called Program 1. We will have an autograder help us handle the large number of submissions, and to give you quick feedback on your score. Note that at the time of release, the autograder might not be ready. Figure 1: We are making ASCII art of Gladiolus flowers! 3 Quick Task Overview The program needs an implementation of Option 2, to print out the flower pattern. After Option 2 is selected, you need to 1. Prompt the user to enter the number of Sections 2. Read in the integer from the user 3. Display the ASCII flower based on the input from the user. For example, if the user gives 3 then you need to display a flower with 3 heads (each head getting progressively larger. The stem should be two vertical lines, for every head, with alternating offshoots. See the examples in Section 5. 4 Details About How the Program Works You will be adding a new feature to the program in main.cc, that will display an ASCII flower. When the program starts, it starts by prompting the user with a message and informing them of all the menu options. You can see examples of this in Section 5. The menu options are as follows: 1. Display the Hello Graphic: you will have no work to do for this option. When selected, the program will ask for a frame character and this is used in the graphic. See the first example in Section 5 for seeing how this works. Looking at the code for this might be helpful for seeing how to implement the next option. 2. Display the Flower: Program 1 is about implementing this option. When selected, the program should ask for the number of sections in the flower, then display it. 3. Exit the Program: Do nothing and quit the program. You can see the starter code in Section 6. Lines 18-23 are the prompt for the user. Lines 26-27 handle reading the menu choice of the user. Lines 36-73 display the Hello Graphic, if option 1 is selected. Most importantly, your code for printing the flower will start at line 78. 5 Examples of Output Here you can see what happens when you select option 1. The program prompts the user to give a character that will be used for the frame of the graphic, then reads in that character from stdin. Next, it displays the ASCII art. Program 1: ASCII Flowers Choose from the following options: 1. Display the HELL0 graphic 2. Display The Flower 3. Exit the program Your choice >2 Enter number of sections: 1 {: @: / Program 1: ASCII Flowers Choose from the following options: 1. Display the HELLO graphic 2. Display The Flower 3. Exit the program Your choice 2 Enter number of sections: 2 When you select option 2, the program will prompt for the number of sections for the flower. Here is an example of what you should print when there is only one section. Below, you can see examples of when there are 2 and 3 sections respectively. Program 1: ASCII Flowers Prompt for the number of flower layers and display Course: CS 141, Fall 2023 System: Linux_x86_64 and G++ Author: George Maratos and David Hayes \#include iostream \#include iomanip using namespace std; int main() \{ II display the prompt to the user cout "Choose from the following options: " "; I read in the user's choice int menu_option; cin > menu_option; I handle option to quit if (menu_option ==3 ) \{ exit (0); 3 II handle the HELLO graphic choice if (menu_option ==1 ) \{ char frame; cout frame; I/top border cout endl; for (int i=0;i

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions