Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE I NEED HELP WITH THIS. I NEED THE CODE FOR THE FILES OF Customer.cpp, Customer.h, Tools.cpp, Tools.h DIY (50%) Twitter is a social media

PLEASE I NEED HELP WITH THIS.

I NEED THE CODE FOR THE FILES OF Customer.cpp, Customer.h, Tools.cpp, Tools.h

DIY (50%)

Twitter is a social media site whose primary purpose is to connect people and allow them to share their thoughts with a big audience. Complete a program that receives tweets information for an unknown number of users. This information includes user_name, likes_count, retweets_count, replies_count, and share_videos (Y/N) on Twitter. At the end of the entry process, the user presses enter instead of entering the user name to end the program. This will end the program and display all the tweets' reports for the entered users.

Tester Program (main.cpp)

This module is fully provided. Please do not change any of its code. Review it and make sure you understand how the functions that you have developed are being used.

Implementation

This application is implemented in three modules:

main Module (fully provided)

Tools Module (fully provided)

Customer Module (implement)

Your task is to complete the implementation of the Customer module to provide the functions needed in the main module.

You may freely use or copy any logic or code needed from the LAB section

Structs to be used:

 struct Customers { char user_name[21]; int retweets_count;; int likes_count; int replies_count; char share_videos; }; struct CustomersRecord { Customers* ptr_rec; // Dynamically holds the customers' tweets report. int noOfRecords; };

Required functions (mandatory)

Implement 2 overloads of a function called EmptyRecord

void EmptyRecord(...........); Sets Customer data members to an empty state

void EmptyRecord(...........); Sets CustomersRecord data members to an empty state

Implement the follwoing five functions

1. bool read(Customers& rec); 

Requests to enter "user name: " and then reads a CString into the name of the Customer reference. If the user enters a value of the user name, then it will read the likes_count, retweets_count, replies_count, and share_videos of the Customer and returns true. Otherwise, if the CString for the name is empty after entry, the function returns false.

2. void read(char* str, int len); 

Reads a CString into the str pointer up to len characters.

This function is already implemented and is provided in the Customer module

3. void addCustomer(CustomersRecord& t_rec, const Customers& c_rec); 

Adds a Customer to the dynamically allocated memory of customers in CustomersRecord

4. void display(const Customers& c_rec); 

Prints the Customer information as follows:

user name

comma and space ", "

likes

comma and space ", "

re-tweets

comma and space ", "

replies

comma and space ", "

share videos (y/n)

new line " "

5. void display(const CustomersRecord& t_rec)

It prints a row number with a period before each user name. Then, it prints all the customers' records.

Files to submit:

Customer.cpp

Customer.h

Tools.cpp

Tools.h

Data Entry

zebaism 595 234 27 n rohanv 12 0 1 n frank 15 2 0 n desibrah 39 19 2 y sheetut 1 0 3 y 

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 Databases questions

Question

What aspects would it be impossible to capture?

Answered: 1 week ago

Question

Enhance your words with effective presentation aids

Answered: 1 week ago