Page 1 of 1

Consider a news agent provides two types (Subject) of news: sport and politics. Each Subject has title and message. Assu

Posted: Mon Jun 06, 2022 2:26 pm
by answerhappygod
Consider a news agent provides two types (Subject) of news:
sport and politics. Each Subject has title and message. Assumes
there are three types of people: Leader, Worker and Student where
each one of them is interested in two subjects.
The Leader can do the following when receive update from any
subject:
1. For Politics, print the title in capital letter.
2. For Sport, print the count of characters in the message.
The Worker can do the following when receive update from any
subject:
1. For Politics, print the reverse string of the title.
2. For Sport, print the first half of the message.
The Student can do the following when receive update from any
subject:
1. For Politics, print the count of white spaces in the
title.
2. For Sport, print the number of words in the message.