Question: in C + + * In your own program feel free to change the function signature. For now, please first get it to work as

in C++
* In your own program feel free to change the function signature. For now, please first get it to work as is.
* You may assume and have been imported.
* You may assume a function nCharString has been implemented, and you will want to call it for stars and spaces.
* string nCharString(size_t n, char c) produces a string of n c's. For example, nCharString(5,'*') returns "*****"
* and nCharString (7,'') will return 7 spaces.
*/
// TODO: Your code here. Use the comments to see the expected format of the menu.
// first print width *'s followed by an endl
/** Next, for each string s in the array:
* cout a star, a space, the item Number a space a hyphen another space, s,
* and enough spaces to get to a length of width -1(enough will depend on the length of the current menu item).
* Close the line with a star and an endl. The goal is that the stars on the right align with each other and each line
* has the same width, passed in as a parameter.
*(Hint: calculate the needed number of spaces and use nCharString to produce them)
* Skip a line after each line except the last line
*/
// outside the loop print another width *s followed by an endl

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!