Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C#, Console App (.NET Framework) Please provide the code with Visual Studio Studio screenshot please and thank you. Output: Assignment 2 - Implement a
In C#, Console App (.NET Framework)
Please provide the code with Visual Studio Studio screenshot please and thank you.
Output:
Assignment 2 - Implement a TikTok Class. Due: Submission date will be decided by your instructor. Recommended due date at the end of week 6. TikTok is a video-sharing social networking service owned by ByteDance, a Chinese company founded in 2012 by Zhang Yiming. It is used to create short dance, lip-sync, comedy and talent videos. ... As of 2018, TikTok has been made available in over 150 markets, and in 75 languages. TikTok was downloaded more than 104 million times on Apple's App store during the full first half of 2018 , according to data provided to CNBC by Sensor Tower. It surpassed Facebook, YouTube and Instagram to become the world's most downloaded iOS app (https://en.wikipedia.org/wiki/TikTok). This assignment attempts to model this social phenomenon. It involves an enum and two main classes: Audience, TikTok and TiktokManager. You will load a set of tikoks from a local file into a List collection. You will perform some simple queries on this collection. The Tikok and the TikokManager classes must be in separate files and must not be in the Program. cs file. The Audience enum may be implemented in the Tiktok.cs file. The Audience Enum 4 Marks This enum specifies the intended audience for this tiktok. It consists of three constants as shown in the table below: The TikTok Class 23 Marks The TikTok class consist of ten members that include two static ones (the members decorated with The $ symbol is used to denote that this member belongs to the type rather than a specific object and you must use the type to access that member. Fields: 1. _ID - this private field is a class variable, it represents the number to be used in setting the id of this item. Properties: All of the properties are readonly and are self-explanatory. 1. Originator - this property is a string representing the originator of this tikok. The getter is public and the setter is absent. 2. Length - this property is an int representing the length in second recipient of this tikok. The getter is public and the setter is absent. 3. HashTag - this property is a string representing the hashtag of this tikok. The getter is public and the setter is absent. 4. Audience - this property is a string representing the distribution of this tikok. The getter is public and the setter is absent. 5. Id-this property is a string representing the id of this tikok. The getter is public and the setter is absent. This is used to uniquely identify a tikok. Methods: 1. public TikTok(string originator, int length, string hashTag, Audience audience) - This public constructor takes four string parameters. This constructor does the following: a. Assigns the arguments to the appropriate properties. b. Sets the Id property using the class variable_ID. c. After the Id property is set, the _ID is then incremented so that the next assignment will be unique. (see description of Id above) 2. private TikTok(string id, string originator, int length, string hashTag, Audience audience) - This public constructor takes five string parameters. This is called by the static TikTok Parse(string) method. This constructor does the following: a. Assigns the arguments to the appropriate properties. Methods: marks 1. public override string ToString()-This method overrides the same method of the Object class. It does not take any parameter but return a string representation of itself. You decide on the format for the output. 2. public static TikTok Parse(string line) - This is a public class method that takes a string argument and returns a TikTok object. It is used to create a TikTok object when loading the TikToks from a file. The argument represents a single line of input read from the file. This method does the following: a. Uses the method of the string class is to chunk the input into four strings. The default delimiter for the Split() method is a space, however in this case the delimiter should be a tab. To specify an argument for the Split () method use the following code: Split(' \t); parameter. This constructor does the following: a. Initialize the TIKTOKS field to a new list of tiktok b. Opens the file specified by the filename field for reading c. Using a looping structure it does the following: i. Reads one line from the file. ii. Passes this line to the static Parse() method of the TikTok class to create a tiktok object. iii. The resulting object is added to the tiktok collection. iv. This is repeated until the input from the file is empty (nul1). 2 marks 2. public static void Initialize() -This class method it used to facilitate the development This will be used to test your code of this project. It will not be used in the production in the event you cannot figure out code, just while developing. This method does the the file reading part. following: a. Assigns the TIKOKS field b. Creates about 5 tiktoks objects and add them to the tiktok collection. 2 marks 3. public static void Show() - This is a public class method that does not take any argument that does not return a value. It displays all the tiktoks in the collection. This is good example of method overloading, i.e. methods with the same name. 2 marks 4. public static void Show(string tag) - This is a public class method that takes a string argument that does not return a value. It displays all the tiktoks with hashTag matching the argument. This comparison must be case in-sensitive. 2 marks 5. public static void Show(int length) - This is a public class method that takes an int argument that does not return a value. It displays all the tiktoks with length greater than the argument. i. public static void Show(Audience audience)-This is a public class method that takes an int argument that does not return a value. It displays all the tiktoks with audience matching the argument. Testing 2 Marks In your test harness (the Main() method in the Program Class), write the code to test all the methods of the TikTokManager class including the Initialize() method. parameter. This constructor does the following: a. Initialize the TIKTOKS field to a new list of tiktok b. Opens the file specified by the filename field for reading c. Using a looping structure it does the following: i. Reads one line from the file. ii. Passes this line to the static Parse() method of the TikTok class to create a tiktok object. iii. The resulting object is added to the tiktok collection. iv. This is repeated until the input from the file is empty (nul1). 2 marks 2. public static void Initialize() -This class method it used to facilitate the development This will be used to test your code of this project. It will not be used in the production in the event you cannot figure out code, just while developing. This method does the the file reading part. following: a. Assigns the TIKOKS field b. Creates about 5 tiktoks objects and add them to the tiktok collection. 2 marks 3. public static void Show() - This is a public class method that does not take any argument that does not return a value. It displays all the tiktoks in the collection. This is good example of method overloading, i.e. methods with the same name. 2 marks 4. public static void Show(string tag) - This is a public class method that takes a string argument that does not return a value. It displays all the tiktoks with hashTag matching the argument. This comparison must be case in-sensitive. 2 marks 5. public static void Show(int length) - This is a public class method that takes an int argument that does not return a value. It displays all the tiktoks with length greater than the argument. i. public static void Show(Audience audience)-This is a public class method that takes an int argument that does not return a value. It displays all the tiktoks with audience matching the argument. Testing 2 Marks In your test harness (the Main() method in the Program Class), write the code to test all the methods of the TikTokManager class including the Initialize() method. tiktoks - Notepad
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started