In Java define classes for a LikeYelp class that manages rev
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
}
}

