In Java define classes for a LikeYelp class that manages rev

In Java, define classes for a LikeYelp class that manages reviews about stores. You need to fill in the LikeYelp class and outline supporting classes. For the supporting classes, you need to provide the signatures for the methods and enough instance variables to support the methods, but you do not need to write the code for the methods. You need to write the entire LikeYelp class so it supports the following Add a store, which has a name and an address Add a review for a store ignore the review if the store is not in the list of stores a review includes the user name of the person giving the review, the name of the store, an integer rating of 1 to 5, a comment on the store for this question, assume the store name is unique evaluate it the review is fake or not - it so, do not add the review. A review is determined to be fake if; the comment is shorter than 20 characters and the rating is either a 1 or a 5 the rating and comment are a duplicate of another review for the same store the user name is null or shorter than 5 characters long Get the average rating for a store Display reviews for a selected store

Solution

class Review{

String userName;

String personName;

String storeName;

int rating;

String comment;

Review(String un,String pn,String sn,int r,String c){ // Constructor to intialize userName ,personName, storeName, // rating, comment

}

void getData(){ // Print review instance variables

}

int getRating(){// return rating

}

}

class Store{

String name ;

String address ;

ArrayList<Review> r;

store(String n , String a){ // Constructor to intialize name , address , and r

}

void addReview(String un,String pn,String sn,int r,String c){//Using Review constructor and add to r

// Check 20 > character comment size and ( 1 or 5 ) rating , error message if true

// user name null or 5> user name size , error message if true

// check for duplicate review in r , error message if true

// else add review to r

}

float getAverageRating(){ // Using r find average rating using getData() from Review class on each instance in r

}

void showReviews(){ // Using r show reviews using getData() from Review class on each instance in r

}

}

class LikeYelp{

ArrayList<Store> s ;

LikeYelp(){ // Constructor to intialize s

}

void addStore(String n , String a){ // Using Constructor in store and add to s

}

void checkStorePresenceToReview(String un,String pn,String sn,int r,String c){// Check store in s

// If present call addReview() using store object with arguments needed

// else ignore

}

}

 In Java, define classes for a LikeYelp class that manages reviews about stores. You need to fill in the LikeYelp class and outline supporting classes. For the
 In Java, define classes for a LikeYelp class that manages reviews about stores. You need to fill in the LikeYelp class and outline supporting classes. For the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site