Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The main part of your code should call a function called main. That should be the only code in your actual main. In the main

The main part of your code should call a function called main. That should be the only code in your actual main.

In the main program, make global list of colors. From the main, call a main function. The main function should call a function called Menu that displays the menu. This function should ask the user to pick a number. If the user picks a number, not on the menu, they should be told to pick again. Once an appropriate number is chosen, the number should be returned to the main function. ***After a user picks a menu option and the action is performed, the Menu function should be displayed again. (Unless Exit is chosen). See the items below to help you create make your menu.

The Main Function should then call the correct function, based on what number in the menu the user chose. For example, if the user chooses 1, a function should be called to Add the color. Some functions may call other functions.

1.Add a color to the list

a.Ask the user what color they would like to add

b.Use a Boolean Function: ifExists as part of the If Function to see if the color already exists

c.If the color already exists, tell the user that the color already exists. Do not add the color

d.If the color does not exist, add the color to the list. Tell the user that the color has been added.

2.View all colors in the list

a.Display all colors in alphabetical order A->Z. Do not display it in list form, display each color on a separate line.

3.View all colors in the list that begin with a letter

a.Ask the user which color they would like the colors to start with.

b.Display all colors in the list that begin with that letter

c.If no color begins with thatletter, a message should display, "Sorry, no colors begin with the letter R". (or any letter that is chosen)

d.If one or more color begins with that letter, the colors should display each one on a separate line.

e.The last line should say: There are (number) colors that begin with (letter).

4.Remove a color

a.Ask the user what color they would like to remove

b.Use the Boolean Function: ifExists as part of the IF function to see if that color exists

c.If the color exists, remove it from the list

d.If the color does not exist, tell the user that the color does not exist and cannot be removed.

5.Exit

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

Students also viewed these Programming questions