You are given an integer, . Your task is to print an alphabet rangoli of size . (Rangoli is a form of Indian folk art based on creation of patterns.) Different sizes of alphabet rangoli are shown below: #size 3----c------c-b-c--c-b-a-b-c--c-b-c------c----#size 5--------e--------------e-d-e----------e-d-c-d-e------e-d-c-b-c-d-e--e-d-c-b-a-b-c-d-e--e-d-c-b-c-d-e------e-d-c-d-e----------e-d-e--------------e--------#size 10------------------j----------------------------------j-i-j------------------------------j-i-h-i-j--------------------------j-i-h-g-h-i-j----------------------j-i-h-g-f-g-h-i-j------------------j-i-h-g-f-e-f-g-h-i-j--------------j-i-h-g-f-e-d-e-f-g-h-i-j----------j-i-h-g-f-e-d-c-d-e-f-g-h-i-j------j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j--j-i-h-g-f-e-d-c-b-a-b-c-d-e-f-g-h-i-j--j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j------j-i-h-g-f-e-d-c-d-e-f-g-h-i-j----------j-i-h-g-f-e-d-e-f-g-h-i-j--------------j-i-h-g-f-e-f-g-h-i-j------------------j-i-h-g-f-g-h-i-j----------------------j-i-h-g-h-i-j--------------------------j-i-h-i-j------------------------------j-i-j----------------------------------j------------------ The center of the rangoli has the first alphabet letter a, and the boundary has the  alphabet letter (in alphabetical order). Function Description Complete the rangoli function in the editor below. rangoli has the following parameters: int size: the size of the rangoli Returns string: a single string made up of each of the lines of the rangoli separated by a newline character (\n) Input Format Only one line of input containing , the size of the rangoli. Constraints   Sample Input 5 Sample Output --------e-------- ------e-d-e------ ----e-d-c-d-e---- --e-d-c-b-c-d-e-- e-d-c-b-a-b-c-d-e --e-d-c-b-c-d-e-- ----e-d-c-d-e---- ------e-d-e------ --------e--------

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

You are given an integer, . Your task is to print an alphabet rangoli of size . (Rangoli is a form of Indian folk art based on creation of patterns.)

Different sizes of alphabet rangoli are shown below:

#size 3----c------c-b-c--c-b-a-b-c--c-b-c------c----#size 5--------e--------------e-d-e----------e-d-c-d-e------e-d-c-b-c-d-e--e-d-c-b-a-b-c-d-e--e-d-c-b-c-d-e------e-d-c-d-e----------e-d-e--------------e--------#size 10------------------j----------------------------------j-i-j------------------------------j-i-h-i-j--------------------------j-i-h-g-h-i-j----------------------j-i-h-g-f-g-h-i-j------------------j-i-h-g-f-e-f-g-h-i-j--------------j-i-h-g-f-e-d-e-f-g-h-i-j----------j-i-h-g-f-e-d-c-d-e-f-g-h-i-j------j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j--j-i-h-g-f-e-d-c-b-a-b-c-d-e-f-g-h-i-j--j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j------j-i-h-g-f-e-d-c-d-e-f-g-h-i-j----------j-i-h-g-f-e-d-e-f-g-h-i-j--------------j-i-h-g-f-e-f-g-h-i-j------------------j-i-h-g-f-g-h-i-j----------------------j-i-h-g-h-i-j--------------------------j-i-h-i-j------------------------------j-i-j----------------------------------j------------------

The center of the rangoli has the first alphabet letter a, and the boundary has the  alphabet letter (in alphabetical order).

Function Description

Complete the rangoli function in the editor below.

rangoli has the following parameters:

  • int size: the size of the rangoli

Returns

  • string: a single string made up of each of the lines of the rangoli separated by a newline character (\n)

Input Format

Only one line of input containing , the size of the rangoli.

Constraints

 

Sample Input

5

Sample Output

--------e-------- ------e-d-e------ ----e-d-c-d-e---- --e-d-c-b-c-d-e-- e-d-c-b-a-b-c-d-e --e-d-c-b-c-d-e-- ----e-d-c-d-e---- ------e-d-e------ --------e--------
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning