Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Create a class for a simple blog. The owner of the blog should be able to: (a) Numerically list and display all messages (b) Post

Create a class for a simple blog. The owner of the blog should be able to: (a) Numerically list and display all messages (b) Post a new message (c) Select a specific post and delete it (d) Quit the program Viewers of the blog should only be allowed to: (a) Numerically list and display all messages (b) Quit the program Create a class Viewer and a class Owner that both derive from class Blog. A menu function should be implemented for the Viewer class and Owner class that outputs only the legal choices for that type of user. HINT: You might want to store the blog posts as a vector of strings. Test your class in main() by prompting the user to choose to be either the blog owner or viewer and display the menus accordingly.

image text in transcribedThe yellow part is the sample output. The gray part is the prompt.

Enter o for blog owner menu and v for blog viewer menu:d BLOG MENU (a) Display all posts (b) Post a new message (c) Delete a post (d) Quit Enter your choice: b Enter the message:Hello! This is my first post Message posted to blog as post #1. BLOG MENU (a) Display all posts (b) Post a new message (c) Delete a post (d) Quit Enter your choice:a BLOG POSTS: 1.) Hello! This is my first post. BLOG MENU (a) Display all posts (b) Post a new message (c) Delete a post (d) Quit Enter your choice:d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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 Databases questions