Question: / * PROJECT 2 - Writer's Block Let's create a simple program that will generate random story ideas to assist with writer's block! Read the
PROJECT Writer's Block
Let's create a simple program that will generate random story ideas to assist with writer's block!
Read the code and all of its comments. Follow the instructions contained in the comments to complete this project.
Remember, do not delete or change anything already in this file.
When finished, compress this project into a ZIP folder and submit it to Canvas.
#include
Add the cstdlib, string.h and vector libraries.
using namespace std;
int main
Create a vector of type int called ideas.
This vector will contain all the random ideas entered by the user.
Create a string called newIdea.
When the user chooses to enter a new idea, this string will be used to contain it and add it to ideas.
Create two integers called choice and randomIndex.
choice will be used to select an option from the switch statement that serves as the bulk of this project.
randomIndex will be used to select the idea to pull from ideas.
Print the user's options and prompt them for input.
See the indented instructions for which options they have.
Create a dowhile loop that performs the bulk of this project's tasks.
This loop repeats as long as choice is anything other than zero.
The indented instructions represent tasks that the loop should perform.
Prompt the user to select an option.
Create a switch statement that uses choice to select case.
Case allows the user to enter a new idea.
Remember to use cin.ignore and getline for string input.
Case generates a random idea from the ideas vector.
If the vector is empty, case should instead print a message stating this.
Case prints the entire contents of the ideas vector. Each entry should be on its own line.
You should also print the number of entries in the vector.
Case deletes the contents of the ideas vector.
Case exits the program.
Create a default case that notifies the user of their invalid selection.
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
