renewed but DVDS cannot, and DVDS have a shorter loan perio oks. The library may expand in future to include other kinds of e you are designing classes for the library. Which of the designs s most appropriate? praryltem parent class that stores common information such as due date, child classes Book and DVD. ok class and a DVD class that are unrelated, and a Libraryltem class that es an instance of Book or DVD in an instance attribute
Q: Define a new class ShieldedShip that inherits from Fighter. Add a variable property shieldStrength…
A:
Q: Recall the Rectangle and Cube classes discussed earlier, as shown in Figure 10-18. a) Is the…
A: a) Rectangle r = new Cube(10, 12, 5); The above statement is legal because class Cube extends from…
Q: Explain when to implement the Big Three. Explain your answer above about which classes need the Big…
A: Given : A) Explain when to implement the Big Three. Explain your answer above about which classes…
Q: highlight the correct answer and provide proper explanation 6. A class should take any…
A: 6. d. public class xyz <T extends Integer> 7. d error
Q: Create class called Test with main method to do the following: I. create the following objects…
A: public class Animal{ //declaring instance variables private String name; private double…
Q: If class Apple extends class Fruit, which of the following is also true? O Fruit is the super class…
A: Correct Answer: - All of the above For Fruit is the super class of Apple It is correct because…
Q: you must define a class named MediaRental that implements the MediaRentalInt interface functionality…
A: Please check the step 2 for solution
Q: Q 3. Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add…
A: Given:
Q: Given the following custom class myClass,which of the following statements are TRUE? Select all that…
A: option1 : statement is incorrect a we can initializes in constructor without needed to passed as…
Q: Design Australia class and England class which inherit from Cricket class so that the following code…
A: Coded using Python 3.
Q: Implement the following: 1) Define a class Job with two attributes title and salary. 2) Define an…
A: The problem is based on the basics of classes and objects in python programming language.
Q: Make a class Car,attributes make, price and odometer to record the make, price and odometer of a…
A: Answer :
Q: is needed to create a new instance of the class? O A field O An instance attribute OA constructor A…
A: A class is a collection of attributes and methods which act as a template to create different…
Q: Answer each of the following. Be consise! Put your answers in a file called shortanswers.txt (a…
A: PART A:- Making each role a subclass of User class is not a good idea because:- 1. In this case each…
Q: 1. A class with no access modifier can be accessed by package-mate classes without being imported.…
A: Find the answer with explanation given as below :
Q: A publishing house prints and distributes two types of publication: books and journals. Each book…
A: Solution: Given: book:Tittle,author,edition number and ISBN. journel: tittle,voilume…
Q: Create a class named ClassA. Define two instance variables along with getter and setter named: att1,…
A: Constructor is a special member function of the class. It is a method that has the same name as that…
Q: For which of these visibility modifiers, the attributes and methods of a super class be accesse from…
A: Dear Student, Void is not a visibility modifier , We can access the attributes and methods of a…
Q: Given the following code, which statement is true? class Water() { ... } class Juice() extends Water…
A: Answer: The correct answer is A) ApplePie is a composite class that contains an instance of Apple…
Q: Define a class namely RegularAcc for online shopping with attributes name (string), balance…
A: Program: #include <iostream> using namespace std; class RegularAcc{ public:…
Q: Assume a class Triangle has been defined. It has three instance data, Point p1, p2, p3. The class…
A: import java.util.Scanner; class point { private double x; private double y; public…
Q: highlight the correct answer 6. A class should take any number as an argument but no other…
A: The question is to choose correct options for the given questions.
Q: Consider the class Movie that contains information about a movie. The class has the following…
A: Here is the c++ code: See below step for code.
Q: Tolder alPractical" and upload the file. Q1. Draw the class diagram and type the program in JCreator…
A: As per our company guidelines, we are supposed to answer only first 3 subparts. Kindly repost other…
Q: In a popular game called T-Rex Chrome Dino Game ( chromedino dot com) consider the following: - As…
A: We need to find on which language T-Rex Chrome Dino Game is written and what are different types of…
Q: Given the following custom class (myclass, which of the following statements are TRUE? Select all…
A: Below are the answers with explanation:
Q: You will create Cart class as a context class to get total price and add product. ◦ To implement…
A: The program has three classes. One is Cart with attributes get total price and products. Second is…
Q: Assume that you have a class Apple which is a subclass of Fruit. Which statement can be used in…
A: A class which is derived from another class is called a subclass or child class and from which class…
Q: Where creating classes, we prefer to hide our data from the outside world in order t ensure…
A: The correct option is
Q: Design, implement and test a Python class, called SphereAlly, to be used by a galactic non-profit…
A: The code is given below. Note: sample results are not provided, printed results may look different…
Q: Q#3: Create a class named "Employee" having first name, last name, id and salary as attribute. There…
A: Given:
Q: In example B are the classes that scott teaches referring the same object as the classes…
A: Yes is correct answer
Q: (7) SIMUOW_F class is a subclass of SIMUOW_1 class. SIMUOW_F object has a name, a gender, a student…
A: Answer: our guide line is answer first three question or subpart from the first question. so i have…
Q: Consider the class Movie that contains information about a movie. The class has the following…
A: Below I have provided a C++ program for the given question. Also, I have attached a screenshot of…
Q: Q# A program that has no graphical user interface and only takes input through the command line only…
A: Note: Since the Question is multiple one. We are advised to do only first question. Kindly post…
Q: Consider the following class: public final class Midterm{ int x =1; public Midterm(){} } What can be…
A: In the above example as we can see it is a class that is created in the public mode. and also…
Q: Given the following custom class myClass, which of the following statements are TRUE? Select all…
A: I'm providing the answer to above question, which is incorrect & which is correct as well as…
Q: Fraction class
A: Solution: After changing the “Fraction” class’s instance variables to “private”, if the client class…
Q: Write a new class called DistanceFitnessTracker that extends FitnessTracker . DistanceFitnessTracker…
A: Actually, java is a object programming language. It is a platform independent.
Q: Which of the following is the correct way to call the constructor of the parent class? Select one: O…
A: Introduction: Here we are required to explain the answers of above two MCQ questions about OOP's and…
Q: Rahul has a Dell company's laptop with 4 GB RAM, 1 TB HDD, 2 GB Graphics card, Windows 10, and…
A: Solution Programming Approach Using header file Using standard namespace creating class Declare…
Q: Multiple questions in Java Q1 :To instantiate an object, you use the ___________ key word . select…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: 5. In a new Java file, create the Monkey class, using the specification document as a guide. The…
A: the answer is given below:-
Q: Given the following custom class myClass , which of the following statements are TRUE? Select all…
A: Given class has 3 attributes code, name and roster. -------------- Statement 1 is incorrect. Because…
Q: Given the following custom class myClass , which of the following statements are TRUE? Select all…
A: Given class has 3 attributes code, name and roster.--------------Statement 1 is incorrect. Because…
Q: Design TomCruise class and DulquerSalman class which inherit from Actor class so that the following…
A: Here in the class Actor, I ahve defined the function named add_movie() that takes a list as input…
Step by step
Solved in 2 steps
- The Critter class is a base class with some basic functionality for running simulations of different kinds of critters. Critters can move, act, and remember their history. A typical simulation contains a number of critters of different types. In each step of the simulation, the act member function will be called on each critter. Define a class Sloth derived from Critter that simulates a sloth. Sloths alternate between eating and sleeping. Add the word "eat" or "sleep" to the history each time the act function is called. The implementation of the Critter class is not shown. Complete the following file: sloth_Tester.cpp #include <iostream>using namespace std; #include "critter.h" /**A sloth eats and sleeps.*/class Sloth : public Critter{public:Sloth();. . .private:. . .}; Sloth::Sloth(){. . .} void Sloth::act(){if (...) {add_history("eat");...}else{add_history("sleep");... }} int main(){Sloth sloth;sloth.act();cout << sloth.get_history() << endl;cout <<…Your assignment for this course is to implement a beginner level Book Management System (BMS) in Java language. BMS contains 2 classes: Bookand BookList. The Book class has the following attributes: code: a String object, that hold the book’s code. title: a String object, that hold the book’s title. qua: int variable, that hold the number of books with the same code in the library. price: a double variable, that hold the book’s price. The BookList class contains only one data member: ArrayList<Book> t. When running the program display the menu as below:1. Input & add book(s) to the end.2. Display all books.3. Search a book for given code.4. Update the book’s price for given code.5. Find the (first) max price value.6. Sort the list ascendingly by code.7. Remove the book having given code.8. Load data from file.0. Exit.Notes:(1) The book’s code must be unique in the list.(2) Display all books in format (code, title, quantity, price).(5)…B - RobotFriend Create a RobotFriend class. RobotFriend is a new toy just on the market. Copy the starter class and the tester from Codecheck. A RobotFriend has a name and replies to various commands Provide a constructor that takes the name of the RobotFriend as a parameter. Remember that a constructor has the same name as the class. What does the class need to remember? That is the instance variable. Provide the following methods: public String getName () gets the name of this RobotFriend • public void setName (String newName) sets a new name for this RobotFriend • public String whatDoYouNeed () returns a string consisting of name + needs a battery charge" where name is the name of this RobotFriend (which was supplied in the constructor) public String doCommand (String whatToDo) returns a string consisting of "Your friend " + name + does not + whatToDo where name is the name of this RobotFriend and whatToDo is the parameter
- T/F1. Interface classes cannot be expanded, but implementation classes may.1. Design a new Triangle class that extends the abstract GeometricObject class. Draw the UML diagram for the classes Triangle and GeometricObject then implement the Triangle class. Write a test program that prompts the user to enter three sides of the triangle, a color, and a Boolean value to indicate whether the triangle is filled. The program should create a Triangle object with these sides, and set the color and filled properties using the input. The program should display the area, perimeter, color, and true or false to indicate whether it is filled or not.using java programmingWrite the Movie class. The UML diagram of the class is represented below: 1. Implement the class strictly according to its UML one-to-one (do not include anythingextra, and do not miss any data fields or methods). 2. Implement a MovieTest class to test the class Movie you just created.• Create two Movie objects: one using the no-args constructor and one from theconstructor with all fields.• Print the contents of both objects. Please submit a screenshot. Hint: toString()method.
- : Imagine you have a call center with three levels of employees: respondent, manager,and director. An incoming telephone call must be first allocated to a respondent who is free. If therespondent can't handle the call, he or she must escalate the call to a manager. If the manager is notfree or not able to handle it, then the call should be escalated to a director. Design the classes anddata structures for this problem. Implement a method dispatchCall () which assigns a call tothe first available employee.A company plans to create a system for managing of a sound recording company. The sound recording company has a name, address, owner and performers. Each performer has name, nickname and created albums. Albums are described with name, genre, year of creation, number of sold copies and list of songs. The songs are described with name and duration. Design a set of classes with relationships between each other, which models the data of the record company. Implement a test class, which demonstrates the work of rest of the classes. c sharpDesign an Essay class that is derived from the GradedActivity class presented in thischapter. The Essay class should determine the grade a student receives on an essay.The student’s essay score can be up to 100, and is determined in the following manner:• Grammar: 30 points• Spelling: 20 points• Correct length: 20 points• Content: 30 pointsDemonstrate the class in a simple program.
- A Door Class A computer game usually has many different objects that can be seen and manipulated. One typical object is a door. Whether a player runs through a castle, attacks the forces of an evil empire, or places furniture in a room, a door often comes into play. Implement a Door class as described below as well as a TestDoor class that instantiates three Door objects labeled “Enter,” “Exit,” and “Treasure.” The “Enter” door should be left unlocked and opened. The “Exit” door should be left closed and locked. The “Treasure” door should be left open but locked. A Door class A Door object can • display an inscription, • be either open or closed, and • be either locked or unlocked. Here are some rules about how Door’s work. • Once the writing on a Door is set, it cannot be changed. • You may open a Door if and only if it is unlocked and closed. • You may close a Door if and only if it is open. • You may lock a Door if and only if it is unlocked, and unlock a Door if…Person and Customer Classes Write a class named (Person) with data attributes for a person’s name, address, and telephone number. Provide accessors/getters and mutators/setters for each attribute. Write a displayPerson() to print out the attributes of the Person. Next, write a class named (Customer) that is a subclass of the (Person) class. The (Customer) class should have a data attribute for a customer number, and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Provide accessors/getters and mutators/setters for each attribute. Write a display customer() to print out the attributes of the Customer. Demonstrate an instance of the (Customer) class in a simple program.The total cost of a group of items at a grocery store is based on the sum of the individual product prices and the tax (which is 5.75%). Products that are considered “necessities” are not taxed, whereas products that are considered “luxuries” are. The Product class is abstract, and it has a method called getTotalPrice. Your task is to create two subclasses of Product: NecessaryProduct and LuxuryProduct and implement the getTotalPrice method in each of these classes appropriately. Then modify the driver program to instantiate four products (two necessary and two luxury) and store them in the product array, print out each item in the array, and display the total cost of the items. You should not make any changes at all to Product.java, and you should only add to ShoppingTripStartingCode.java. Do not change any code that is already present Example(Cheese and bread are necessities and soda and candy are luxuries)Cheese…