Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / QUESTION 1  In this part you will process collection of Article objects whose structure is shown below:  enum class Month{ January, February, March, April, May, June, July, August, September, October, November, December  }; struct Article {  std ::string m_title;//tit/e of article std::string m_publisherName;//name of publisher Month m_publishedMonth;//month of publication int m_publishedDay;//day of publication int m_publishedHour;//hour of publication  } ;  Create a function named processArticle that receives a collection ( std: :vector ) of A rticle objects and returns a different collection ( std: :vector ) of Article objects

QUESTION 1  In this part you will process collection of Article objects whose structure is shown below:  enum class Month{ January, February, March, April, May, June, July, August, September, October, November, December  }; struct Article {  std ::string m_title;//tit/e of article std::string m_publisherName;//name of publisher Month m_publishedMonth;//month of publication int m_publishedDay;//day of publication int m_publishedHour;//hour of publication  } ;  Create a function named processArticle that receives a collection ( std: :vector ) of A rticle objects and returns a different collection ( std: :vector ) of Article objects

Computer Science

QUESTION 1 
In this part you will process collection of Article objects whose structure is shown below: 
enum class Month{ January, February, March, April, May, June, July, August, September, October, November, December 
}; struct Article { 
std ::string m_title;//tit/e of article std::string m_publisherName;//name of publisher Month m_publishedMonth;//month of publication int m_publishedDay;//day of publication int m_publishedHour;//hour of publication 
} ; 
Create a function named processArticle that receives a collection ( std: :vector ) of A rticle objects and returns a different collection ( std: :vector ) of Article objects. Your function must perform the following tasks on the received collection using c++ stan-dard template library algorithms: 
1. Sort only the first half of the Article objects in the collection in descending order based on their hour of publication. 
2. Display each Article object's data from the collection published in the month of Ma rch in the following format: {title text}(Title), {publisher text}(Publisher), {da y number}(Day), {hour number}(Hour) . Each object's data should be printed on a new line to the standard output stream. 
3. Print the number of Article objects that were published in the month of February to the standard output stream. 
4. Transform all the Article objects in the received collection by appending the publisher's name (within brackets) to the corresponding title. Example, if title is Five reasons why Ontario and publisher name is cry News , then the title of the trans-formed object becomes Five reasons why Ontario (CTV News) . Store the trans-formed objects in a newly created collection ( std: :vector ). Your function returns this collection after processing in the next task. 
5. Print the concatenated titles of all the Article objects in the collection created in the previous task, separated by pipe I character. Example, if the titles of three Articl e objects are Two golf students (CTV News) , Ontario arborist survives (CBC New s) , and Ontario man has (CityNews) , then the concatenated title should be 'Two g olf students (CTV News)lOntario arborist survives (CBC News)lThe golf students (CityNews)l . 
 

Option 1

Low Cost Option
Download this past answer in few clicks

12.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE