WHAT I NEED HELP IS WITH GETTING RID OF THE COLONS GETTING PRINTED OUTSIDE OF THE CURLY BRACKETS AND ALSO GET RID OF THE COLONS FROM WHERE THE STEMS(|/,|) ARE SO IF SOMEONE CAN HELP ME WITH THAT, I ONLY WANT THE COLONS TO BE INSIDE OF THE CURLY BRACKETS AND NOT OUTSIDE. UNDERNEATH IS ALSO A PICTURE OF WHAT THE OUTPUT SHOULD LOOK LIKE

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I need help with my c++ code for a flower here is my code:

#include<iostream>
#include<iomanip>
using namespace std;
// function to print the menu
void printMenu()
{
cout<<"Program 1: Gladiolus"<<endl;
cout<<"Choose from among the following options:"<<endl;
cout<<"1. Display original graphic"<<endl;
cout<<"2. Display Gladiolus"<<endl;
cout<<"3. Exit the program"<<endl;
}
// function to print given number of white spaces
void printSpaceForward(int count)
{
for(int i = 1; i <= count; i++)
cout<<":";
}
// function to display gladiolus flower with given number of sections
void displayGladiolus(int sections)
{
// level of sections
for(int i = 1; i <= sections; i++)
{
printSpaceForward(sections);
cout<<"---"<<endl;
// print the upper part of a level, upto the '@' character level

for(int j = 1; j <= i; j++)

{

printSpaceForward(sections-i);

printSpaceForward(i-j);

 

cout<<"(";

printSpaceForward(j);

if(i==j)

cout<<"@";

else

cout<<":";  // <-- error here

 

printSpaceForward(j);

cout<<")"<<endl;

}

 

// print the lower part of a level

for(int j = i-1; j >= 1; j--)

{

printSpaceForward(sections-i);

printSpaceForward(i-j);

 

cout<<"(";

printSpaceForward(j);

if(i==j)

cout<<"@";

else

cout<<":";  // <-- error here

 

printSpaceForward(j);

cout<<")"<<endl;

}
}
printSpaceForward(sections);
cout<<"---"<<endl;
// print the stem part
for(int i = 1; i <= sections; i++)
{
// for even count, print \|
if(i%2 == 0)
{
printSpaceForward(sections);
cout<<"\\|"<<endl;
printSpaceForward(sections+1);
cout<<"|"<<endl;
}
// for odd count print |/
else
{
printSpaceForward(sections+1);
cout<<"|/"<<endl;
printSpaceForward(sections+1);
cout<<"|"<<endl;
}
}
}
// function to print the graphics

// main method
int main()
{
int choice, sections;
printMenu(); // print the menu
// accept user's choice
cout<<"Your choice -> "<<endl;
cin>>choice;
// compare user's choice and call appropriate methods
switch(choice)
{
case 1: 
break;
case 2: cout<<"Number of sections -> ";
cin>>sections;
if(sections > 0)
displayGladiolus(sections);
break;
case 3: exit(0);
default: cout<<"\nInvalid choice!";
}
cout<<"\nExiting"<<endl;
return 0

 

WHAT I NEED HELP IS WITH GETTING RID OF THE COLONS GETTING PRINTED OUTSIDE OF THE CURLY BRACKETS AND ALSO GET RID OF THE COLONS FROM WHERE THE STEMS(|/,|) ARE SO IF SOMEONE CAN HELP ME WITH THAT, I ONLY WANT THE COLONS TO BE INSIDE OF THE CURLY BRACKETS AND NOT OUTSIDE. UNDERNEATH IS ALSO A PICTURE OF WHAT THE OUTPUT SHOULD LOOK LIKE

{:::}
{:::::}
{:::@:::}
{:::::}
{:::}
{:::}
{::::}
{:::}
{:@:}
Transcribed Image Text:{:::} {:::::} {:::@:::} {:::::} {:::} {:::} {::::} {:::} {:@:}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY