Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete User.cpp C++ User.cpp #include #include #include User.h User::User(string name){ } /** Create a pointer to a post (use new) [example: Post* q = new

Complete User.cpp C++

User.cpp

#include

#include

#include "User.h"

User::User(string name){

}

/** Create a pointer to a post (use "new") [example: Post* q = new Post("Homework","Thu Sep 12 2018");]

and then add it to the linked list (create a new node, etc)

You have already implemented the queue in the class, you know!

*/

void User::addPost(string value,string time){

}

/**Using the head_posts, you can go through the posts and print them out (cout)

you should print them out like this:

"username" wrote "content of the post" at "time of the post"

For example

Jose wrote I am a great programmer at Thu Aug 30 14:23 2018.

*/

void User::showPosts(){

}

User.h

#ifndef USER_H

#define USER_H

#include

#include "Post.h"

using namespace std;

class User

{

public:

//This Node class is used for linked list that keep posts

class Node {

public:

Post* p;

Node* next;

};

User(string name);

/** Create a pointer to a post (use "new") [example: Post* q = new Post("Homework","Thu Sep 12 2018");]

and then add it to the linked list (create a new node, etc)

You have already implemented the queue in the class, you know!

*/

void addPost(string value,string time);

/**Using the head_posts, you can go through the posts and print them out (cout)

you should print them out like this:

"username" wrote "content of the post" at "time of the post"

For example

Jose wrote I am a great programmer at Thu Aug 30 14:23 2018.

*/

void showPosts();

private:

string name;

Node* head_posts;

Node* tail_posts;

int numberOfPosts;

};

#endif

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

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago