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
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
Sample Output 2
Sample Output 3
Step by step
Solved in 5 steps with 2 images