Question: Question 3 Each data element of the listOfBooks array created above will need to be an instance of BN_Books. In order to start working

Question 3 Each data element of the listOfBooks array created above willneed to be an instance of BN_Books. In order to start workingwith the variables of BN_Books, such as name, author, etc., we mustcreate a new instance for each array element with the following code:for (int listIdx=0; list|dx < listOfBooks.length; listIdx++) { } O listOfBooks[listldx] =

Question 3 Each data element of the listOfBooks array created above will need to be an instance of BN_Books. In order to start working with the variables of BN_Books, such as name, author, etc., we must create a new instance for each array element with the following code: for (int listIdx=0; list|dx < listOfBooks.length; listIdx++) { } O listOfBooks[listldx] = 0; O listOfBooks[listldx] = new BN_Book(); O listOfBooks[listldx] = just one BN_Book(); O none of the above Question 4 2 pts O True After I create the list with the array and each element now points to a new instance of BN_Books, I can run a method for any array element like this: listOfBooks[0].set_bookName("Java for fun"); O False 1 pts Question 6 Use the skills in the video above to: 1. Create a class definition called StarRating with these instance variables: -userRating: int - Review: String Notes: the userRating is a whole number so a user can only rate 3 or 4 starts but not, 3.5 1. Add the setters and getters. 2. Add logic to the setter methods such that: o the userRating is entered by the user and can only be between 1 and 5. If the user enters any other number, set the userRating = 1. o the Review is entered by the user and can only be a single, short sentence. 3. Add the default constructor 100 pts 4. Add the constructor with all instance variables as parar 5. Add a private helper method call Draw. The draw method should take no parameters and will return nothing. The purpose of draw will be to print as many asterisks (*) as the value in the User Rating variable. Use a for loop. Suppose, userRating = 4, then the Draw method should print 4 asterisks (****) on one line. There will never be a userRating of O because of the logic you added in step #3 above. Draw should be written such that the output looks like this: outputOfDraw.jpg 6. *If Draw is private, how are you going to call it from an outside class? If you need to, you can add a driver file to test this class but you are not required to! No Demo or driver file is needed at this time. Upload your StarRating.java file here. Upload Choose a File n Question 9 1. Review the technique taught to you in the videos above. 2. For the 2 class definitions described below, you will need to create a new class and include the following items: 100 pts UML in comments o private instance variables o default constructor ensuring that a new StarRatings() gets constructed as well. 1 constructor with all instance variables as parameters ensuring that the StarRatings variable is included. o setter methods o getter methods writeOutput() helper method o equals method comparing only the musicName for the MusicPiece class and MovieName for the Movie class toString method 3. Implement Class definition called MusicPiece with the following instance variables. Make them private. Complete the checklist provided in step#2 - Music Name: String -Genre: String - Length: double - JudgeReview: StarRating 4. Implement Class definition called Movie with the following instance variables. Make them private. Complete the checklist provided in step#2. - MovieName: String o - Movie length: double - CriticReview: StarRating If you need to, you can add a driver file to test these class but No Demo or driver file is needed. are not required to! Upload Choose a File This question requires that you upload the MusicPiece.java and Movie.java files. However, canvas does not let you upload 2 files here. Create a compressed .zip file. The compressed zip file will include these 2 files. Upload the .zip file here. Question 10 The class definitions we built so far can be rated with stars. Air conditioners can be rated, Music Pieces can be rated, Movies can be rated. Pick any personal topic that you are passionate about? 1. Review the technique taught to you in the videos above. 2. Decide on one item or entity from your personal topic that can be rated with star reviews. My item/entity example was in the video. It was the CraftProjects example. 3. Create a new class for your personal item/entity and include the following items: UML in comments private instance variables o default constructor 1 constructor with all instance variables as parameters o setter methods getter methods o writeOutput() helper method 100 pts equals method comparing what you think is meaningful. For my example, it was the theme instance variable that compared equality o toString method 4. For your class definition, pick no more than 3 characteristics that describe that entity. Make those characteristics instance variables. Make sure you use a variety of data types here. (String, int, double, etc.) 5. Add an instance variable called CriticRating: StarRating like I did in the CraftsProject example. 6. Edit the default constructor to ensure that a new StarRatings() gets created. 7. Edit the parameter constructor to ensure that the ensuring that the StarRatings variable is included. If you need to, you can add a driver file to test these class but you are not required to! No Demo or driver file is needed. Upload your . java class definition here. Upload Choose a File Question 1 A variable with a class data type holds an Address that points to an instance of the data. O True O False Question 2 The BN_Books class definition looks like this: public class BN_Books { } O //Add some characteristics that describe a book //INSTANCE VARIABLES O True O False //METHODS //SETTER METHOD public void set_bookName(String initial_bookName) { } private String bookName; public String Author; double price; public boolean isPopular; public int publishedYear; if (Author.equals("JK Rowling")) else } bookName = "not interested"; bookName = initial_bookName; //GETTER METHOD public String get_bookName() { Is the following true? In a main method or any other method, an array of BN_Books created like this BN_Books[] listOfBooks = new BN_Books[3]; //keyword to return from a method return bookName; } public double calc_Totalprice(int quantity) { return price* quantity; will create a list for 3 BN_Books. 1 pts 1 pts Attempt due: May 4 0 Minutes, 41 S.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!