1. Creating an Influencer from Different Platforms by Codechum Admin Year 2020 - the sprout of online influencers in every platform available out there. Online influencers, most especially the successful ones are super talented because they're taking advantage of the opportunity that is available at hand. For this program, we will be modeling these influencers.   First, implement an abstract class called Influencer. This class will have the following properties:  private String name  private String platform - this can only be either "Facebook" or "Tiktok"    Then, it will have the following methods:  its constructor which accepts the name and platform. If the platform supplied is not "Facebook" or "Tiktok", set the platform to "Facebook" by default instead.  toString() - returns the following string: "I'm {name} an influencer at {platform}" abstract void doLiveStream()    Then, implement the FacebookInfluencer class which inherits from the Influencer class. This class will have no additional properties and will have the following methods:  its constructor which accepts a name only. It will then call its parent class' constructor and pass the name supplied as well as the string "Facebook" as the platform  an override of the doLiveStream() method. This method will simply print the message "Doing livestream on Facebook, please send stars" with a new line at the end   Finally, implement the TiktokInfluencer class which also inherits from the Influencer class. This will also have no additional properties and will have the following methods: its constructor which accepts a name only. It will then call its parent class' constructor and pass the name supplied as well as the string "Tiktok" as the platform an override of the doLiveStream() method. This method will simply print the message "Doing livestream on Tiktok, please send love" with a new line at the end   In the main, ask the user to select which type of influencer they want to create (1 - Facebook Influencer, 2 - Tiktok Influencer).   Then, ask the user to input the name of the influencer. Basing on these inputs, create the appropriate Influencer object named influencer.   Finally, before you submit your code, uncomment the Tester code line. Sample Output 1 Select Influencer (1 - Facebook, 2 - Tiktok): 1 Enter name of influencer: Rich Isog Enter code: 1 SUCCESS Sample Output 2 Select Influencer (1 - Facebook, 2 - Tiktok): 2 Enter name of influencer: Bella Poarch Enter code: 2 SUCCESS Sample Output 3 Select Influencer (1 - Facebook, 2 - Tiktok): 1 Enter name of influencer: Messi Enter code: 3 SUCCESS

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

1. Creating an Influencer from Different Platforms

by Codechum Admin

Year 2020 - the sprout of online influencers in every platform available out there. Online influencers, most especially the successful ones are super talented because they're taking advantage of the opportunity that is available at hand. For this program, we will be modeling these influencers.

 

First, implement an abstract class called Influencer. This class will have the following properties: 

  • private String name 
  • private String platform - this can only be either "Facebook" or "Tiktok" 

 

Then, it will have the following methods: 

  • its constructor which accepts the name and platform. If the platform supplied is not "Facebook" or "Tiktok", set the platform to "Facebook" by default instead. 
  • toString() - returns the following string: "I'm {name} an influencer at {platform}"
  • abstract void doLiveStream() 

 

Then, implement the FacebookInfluencer class which inherits from the Influencer class. This class will have no additional properties and will have the following methods: 

  • its constructor which accepts a name only. It will then call its parent class' constructor and pass the name supplied as well as the string "Facebook" as the platform 
  • an override of the doLiveStream() method. This method will simply print the message "Doing livestream on Facebook, please send stars" with a new line at the end

 

Finally, implement the TiktokInfluencer class which also inherits from the Influencer class. This will also have no additional properties and will have the following methods:

  • its constructor which accepts a name only. It will then call its parent class' constructor and pass the name supplied as well as the string "Tiktok" as the platform
  • an override of the doLiveStream() method. This method will simply print the message "Doing livestream on Tiktok, please send love" with a new line at the end

 

In the main, ask the user to select which type of influencer they want to create (1 - Facebook Influencer, 2 - Tiktok Influencer).

 

Then, ask the user to input the name of the influencer. Basing on these inputs, create the appropriate Influencer object named influencer.

 

Finally, before you submit your code, uncomment the Tester code line.

Sample Output 1

Select Influencer (1 - Facebook, 2 - Tiktok): 1 Enter name of influencer: Rich Isog Enter code: 1 SUCCESS

Sample Output 2

Select Influencer (1 - Facebook, 2 - Tiktok): 2 Enter name of influencer: Bella Poarch Enter code: 2 SUCCESS

Sample Output 3

Select Influencer (1 - Facebook, 2 - Tiktok): 1 Enter name of influencer: Messi Enter code: 3 SUCCESS
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT