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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply