Question

2. In Java, define classes for a LikeYelp class that manages reviews about stores. You need to fill in the Like Yelp class and outline classes. For the classes, you need class do the signatures for the methods and enough supporting the methods, but to provide so it not to write the instance to support Add a supports for the methods. You need to write the entire Like elp the Add which has a name and an address 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 store, the an integer rating to 5, a on the store for question, this assume the store name is unique evaluate review is fake or not if so, do not add the review. A review is determined to be fake Get the comment is shorter than 20 characters and the rating is either a 1 or a 5 the and comment are a duplicate of another review for the same store Display user name is or shorter than 5 long average rating for a store reviews selected store for
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

}

}

Add a comment
Know the answer?
Add Answer to:
In Java, define classes for a LikeYelp class that manages reviews about stores. You need to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JAVA Problem:  Coffee    Design and implement a program that manages coffees. First, implement an abstract class...

    JAVA Problem:  Coffee    Design and implement a program that manages coffees. First, implement an abstract class named Coffee. The Coffee class has three member variables: coffee type, price, and store name. The Coffee class has an abstract method name ingredient. Make sure to add all necessary setters and getters as well as other methods. The class Coffee implements an interface HowToMakeDrink. The interface has the following method: public interface HowToMakeDrink { public void prepare (); } The prepare method will...

  • Problem: Coffee(Java) Design and implement a program that manages coffees. First, implement an abstract class named...

    Problem: Coffee(Java) Design and implement a program that manages coffees. First, implement an abstract class named Coffee. The Coffee class has three member variables: coffee type(does not mention the data type of the variable coffeeType), price, and store name. The Coffee class has an abstract method name ingredient. Make sure to add all necessary setters and getters as well as other methods. The class Coffee implements an interface HowToMakeDrink. The interface has the following method: public interface HowToMakeDrink { public...

  • JAVA Problem:  Coffee do not use ArrayList or Case Design and implement a program that manages coffees....

    JAVA Problem:  Coffee do not use ArrayList or Case Design and implement a program that manages coffees. First, implement an abstract class named Coffee. The Coffee class has three member variables: coffee type, price, and store name. The Coffee class has an abstract method name ingredient. Make sure to add all necessary setters and getters as well as other methods. The class Coffee implements an interface HowToMakeDrink. The interface has the following method: public interface HowToMakeDrink { public void prepare ();...

  • You must write C# classes which are used to manage product review data for Books and...

    You must write C# classes which are used to manage product review data for Books and Cars. You will write an abstract class called Review which abstracts common properties (review rating and comments). You will then create an Interface responsible for the functionality to display the Reviewcontent. Then, you will create 2 concrete classes which inherit from Review and implement the Interface. Finally, you will create console applicationwhich will create 2 CarReview instances and 2 BookReview instances and display them...

  • JAVA We are learning about java databases in my highschool java class. I Need some help...

    JAVA We are learning about java databases in my highschool java class. I Need some help with it. Create a Java program (feel free to do it all in a main method) that works with a database that contains your 'Contractors' table (see the last exercise). Id (integer, primary key) CompanyName (varchar, 30 characters) Phone(varchar, 12 characters) ContactName(varchar, 30 characters) Rating (integer) OutOfStateService (boolean) # company name phone # Name rating Out of state service 1 Joe's Brewery 1111111111 Joe...

  • I need code in java The Student class: CODE IN JAVA: Student.java file: public class Student...

    I need code in java The Student class: CODE IN JAVA: Student.java file: public class Student {    private String name;    private double gpa;    private int idNumber;    public Student() {        this.name = "";        this.gpa = 0;        this.idNumber = 0;    }    public Student(String name, double gpa, int idNumber) {        this.name = name;        this.gpa = gpa;        this.idNumber = idNumber;    }    public Student(Student s)...

  • C++ language This challenge is designed to reinforce the skills you leamed about classes and objects....

    C++ language This challenge is designed to reinforce the skills you leamed about classes and objects. In this challenge, you're going to create a movie class. The movie class will ask the user for the name of their top three favorite movies, what year the movie was released, and what was the rating, whether it was G for General Audience, PG for Parental Guidance, R for Restricted, or M for Mature. I want you to also add logic to make...

  • In C++. Define a class Country that stores the name of the country, its population, and...

    In C++. Define a class Country that stores the name of the country, its population, and its area. Store the country name as a C-string. Write a main function that initializes an array with at least 5 objects of this class and sorts and prints this array in three different ways: By population By population density (people per square kilometer) Do not ask the user to enter country data. Use qsort to sort the array. Also sort alphabetically by country...

  • JAVA :The following are descriptions of classes that you will create. Think of these as service...

    JAVA :The following are descriptions of classes that you will create. Think of these as service providers. They provide a service to who ever want to use them. You will also write a TestClass with a main() method that fully exercises the classes that you create. To exercise a class, make some instances of the class, and call the methods of the class using these objects. Paste in the output from the test program that demonstrates your classes’ functionality. Testing...

  • In this labwork, you are expected to write java program that assigns ratings to the movies (1-5). You are given the main class of the program(See Lectures). You supposed to write two classes that wor...

    In this labwork, you are expected to write java program that assigns ratings to the movies (1-5). You are given the main class of the program(See Lectures). You supposed to write two classes that works with main class. Movie Class has two attributes: title(String) . rating(int) Reviewer Class has one class variable (array of movies) and three methods: Setmovies: Allow the reviewer's movies to be set . . . rateMovie: Let the reviewer rate one of the movies. pickFavorite: pick...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT