Question: java language In this Assignment you will create a class that represents a Social Media profile (like a Facebook profile many of you have). The
In this Assignment you will create a class that represents a Social Media profile (like a Facebook profile many of you have). The name of this class will be _Sosial Media rotile There are many things we could represent about a Social Media Profile, we'll pick just a few to refresh our class writing skills. * Social Media rotile will have a **nane, an *sage, a **country. ** **urbacofresta ** and unbereflikes... Each of these will be private variables (these private variables must have the same exact names as the bolded names above) with the types int, double, or String (it's up to you to figure out which type for which private variable, not all types might be used). In addition to private saciables you will have the following public methods A constructor that will take in parameters to initialize the private variables in the order they were presented above. The constructor should ensure that anything with a number is not set to a value less than o, if it is, then it initializes it to . 1 Getters and setters for each private variable must follow the naming convention used in the example Student class in Lecture 1 (L. for age we would have **setager* and **getaser+). The setters should ensure that the private variables are never set to an illogical value (ie if the client passes in a negative age to setans, age remains unchanged). A member function, entitled ***xecageLikes Perroste that returns the average likes per post (divide ourbertuskes. by number of posts). If there are no posts, simply return the value e ti.e. make a condition to ensure you do not dividel by e). This takes in no parameters, but it does have a return value you must determine the return type). A **tString method that overrides Object's tasting and prints out the person in the following format (the only spaces are after connas) **Re: Ashokage:37. countrys, numberOfPosts:42, number of Likes: 122. averageLikesPerPost:2.904.. An **equalse method that overrides Object's equals. It should ensure that the object being passed in is a Sosial Media rafile before casting it. Two Social Media Profiles are the same if all the private variables are equal. Renenber to use ase. when comparing two Strings. You can use *** to compare two lots. We won't overload bashcode for now but it is something to ponder **There are Test Cases To this assignment, passing all the test cases is a good indication you did the assignment correctly but does not mean full credit-- you must hit all the requirements Toto
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
