Computers and Technology
Computers and Technology, 25.02.2021 19:00, markel19

A health club chain allows its members to visit any of its many health club locations an unlimited number of times per day. The only constraining rule is, a customer can only visit one health club location per day, even though he or she may return to that location an unlimited number of times for the rest of that day. Although the honor system has always worked quite well, the club wants to run some tests to see how many people really follow the rules. You are to write a program that takes the entrance log files from three different clubs (all logging the same day) and return a sorted list of the people who are not honest and went to more than one health club location in the same day.
The log files are represented as vector's where each element is the member name of a customer who entered that day. For example, if a customer showed up three times to one of the club locations that day, the member's name would appear three times in the corresponding vector.
Notes
club1, club2, and club3 may contain a different number of elements.
The same member name can appear multiple times in a single log file.
The elements of the returned vector should be distinct and sorted in lexicographic order (the order they would appear in a dictionary).
Assume that two people with the same name are in fact the same person.
Constraints
club1, club2, and club3 each have between 1 and 50 elements, inclusive.
Each element of club1, club2, and club3 contains between 1 and 50 characters, inclusive.
Each element of club1, club2, and club3 consists only of uppercase letters ('A'-'Z').
Examples
{"JOHN","JOHN","FRED","PEG"}
{"PEG","GEORGE"}
{"GEORGE","DAVID"}
Returns: { "GEORGE", "PEG" }
"PEG" went to club1 and club2, and "GEORGE" went to club2 and club3.
{"DOUG","DOUG","DOUG","DOUG","DOUG" }
{"BOBBY","BOBBY"}
{"JAMES"}
Returns: { }
Here, no one went to more than one club location.
{"BOBBY"}
{"BOB","BOBBY"}
{"BOB"}
Returns: { "BOB", "BOBBY" }
Note that "BOB" is sorted before "BOBBY"
{"BOBBY","HUGH","LIZ","GEORGE"}
{"ELIZABETH","WILL"}
{"BOB","BOBBY","BOBBY","PAM","LIZ", "BOBBY","BOBBY","WILL"}
Returns: { "BOBBY", "LIZ", "WILL" }
{"JAMES","HUGH","HUGH","GEORGE","EL IZABETH","ELIZABETH","HUGH",
"DAVID","ROBERT","DAVID","BOB","BOB BY","PAM","JAMES","JAMES"}
{"BOBBY","ROBERT","GEORGE","JAMES", "PEG","JAMES","DAVID","JOHN","LIZ",
"SANDRA","GEORGE","JOHN","GEORGE"," ELIZABETH","LIZ","JAMES"}
{"ROBERT","ROBERT","ROBERT","SANDRA ","PAM","BOB","LIZ","GEORGE"}
Returns: { "BOB","BOBBY","DAVID","ELIZABETH"," GEORGE","JAMES","LIZ","PAM","ROBERT ", "SANDRA" }
{"LIZ","WILL","JAMES"}
{"JOHN","ROBERT","GEORGE","LIZ","PE G","HUGH","BOB","BOBBY","ROBERT","E LIZABETH","DAVID"}
{"PAM","DAVID","SANDRA","GEORGE","J OHN","ROBERT","SANDRA","GEORGE"}
Returns: { "DAVID", "GEORGE", "JOHN", "LIZ", "ROBERT" }
{"PEG","ROBERT","PAM","JOHN","DAVID ","JOHN","ROBERT",
"GEORGE","HUGH","WILL","JAMES","JAM ES","BOBBY","BOBBY","SANDRA"}
{"SANDRA","BOB","PAM","JAMES","WILL ","DAVID","BOBBY","GEORGE",
"WILL","LIZ","BOBBY","ROBERT","WILL ","BOB","BOBBY","ELIZABETH","HUGH"}
{"WILL","PEG","ELIZABETH","DAVID"," HUGH","BOBBY","JOHN","SANDRA","ELIZ ABETH",
"ELIZABETH","SANDRA","GEORGE","PAM" ,"ELIZABETH","BOBBY","DAVID","PAM"}
Returns:
{ "BOBBY",
"DAVID",
"ELIZABETH",
"GEORGE",
"HUGH",
"JAMES",
"JOHN",
"PAM",
"PEG",
"ROBERT",
"SANDRA",
"WILL" }
{"AHHOZY","AHHAPLL","ASNV"}
{"AHDLTOE","AHUKPJ","AHDENCTPP","AH DENCJ","AHDLNZC","AHDLTOGG","AHHAPM BG",
"ALE","AHBHA","AHUKP","AHDQMILLP"," AHDENEDY","AHDENEE","AHHOHVCX","AHI SK",
"AHW","AQDB","AHUP","AQDBNPU","AGWZ UV","AHHOSUW","AHXS","AHDENCP","AHD QM",
"AHDLTURV","AHBHVV","AHDQMILL","AHD QMD","AHH","AHDLTU","AHISFNO","AHUR F",
"AH","AHHAPNQ","AQPL","AHDXL","AHDL TUGX","AHDLT","AHUKRC","AHDLTUGX",< br /> "AQDTXYX","AGWZS"}
{"AHHAPMFF","AHURA","AHHOZ","AHISKH ","AHUPR","AHHAPM","AHUKRHIN","AHHA P",
"AHDLTMO","AHDLTUJ","AHDQY","AHUK", "AHDENEDY","AHWK","AHHOZGJJ","AHXS" ,
"AHDLTUREL","AHHOZQNL","AHHOSUWOS"}
Returns: { "AHDENEDY", "AHXS" }
Given Function
#include
#include
vector whos_dishonest(vector &club1,
vector &club2,
vector &club3) {
cout << "[LIZ]" << endl;
// you write code here
}
Complete the Given Function to solve the problem statement. Please follow the given notes and constraints. Please code this problem in C++.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:40, tdahna0403
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
image
Computers and Technology, 23.06.2019 02:50, bfell92
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, erjalinalii
Janice recently received her college degree and is looking for a job. she is worried that since she just finished school, she will be required to repay her perkins and direct subsidized loans immediately. janice pulls out the paperwork she signed and reviews it again for repayment information. after reading all of the information, janice discovers that
Answers: 2
image
Computers and Technology, 24.06.2019 04:30, juliemiddleton05
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
Answers: 1
Do you know the correct answer?
A health club chain allows its members to visit any of its many health club locations an unlimited n...

Questions in other subjects:

Konu
Mathematics, 26.08.2020 04:01