Related questions
Now complete the followign activity:
Part 1: Create a new Java project, name it Chap6-Pet and click Finish and OK. Next, create a new class, name it Pet, and DO NOT check the first check box under "Which method stubs would you like to create?" and click Finish. Study the file PetClassUML.pdf. Code the file "Pet.java" according to this design. Save the file.
Part 2: Next, for the same project, create another class, name it PetDemo, and check the first checkbox under "Which method stubs would you like to create?" and click Finish. This file will serve as a application program. Add code to this file to create 2 Pet objects named pet1 and pet2. Then set their data by calling the appropriate "set" methods from the Pet class, and print their data by calling the appropriate "get" methods from the Pet class:
Sample Output
Pet 1 => Felix 1 cat
Pet 2 => Buddy 2 dog
(THE ATTACHED IMAGES ARE IMAGES OF THE PDF's STATED ABOVE) and the link below is the other pdf (USE THE RECTANGLE CODE IMAGE AND PDF to structure your code using the PET PDF)
- https://learn-us-east-1-prod-fleet01-xythos.content.blackboardcdn.com/blackboard.learn.xythos.prod/5a747c369ad0b/3749298?X-Blackboard-S3-Bucket=blackboard.learn.xythos.prod&X-Blackboard-Expiration=1680760800000&X-Blackboard-Signature=XhRNpXgPd5G6U2WxPz6o%2BUlfq%2FbWDJDlBRsp4%2BeggR8%3D&X-Blackboard-Client-Id=100096&X-Blackboard-S3-Region=us-east-1&response-cache-control=private%2C%20max-age%3D21600&response-content-disposition=inline%3B%20filename%2A%3DUTF-8%27%27RectangleClassUML%2526Code.pdf&response-content-type=application%2Fpdf&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDsaCXVzLWVhc3QtMSJHMEUCIQD4I69lUQyKyYbiTq1LWdrIOQ5COuyk0xORU7Ci4eP15gIgGpLf6Ouge%2FULQ%2BZcaZ40oHPKdedODVW%2FcbS4cIwO%2BZgqswUIJBAAGgw1NTY5MDM4NjEzNjEiDEppinMB9QViShql3CqQBS%2BE5OuDab%2Feb%2FJ03XGsVPHoteEblwE6zA1S7suHOhYNdJqGoxBrn90xKFH8AbcQwRnw1Dc7GQD4YZv5pdUqtuP5Y4%2BJUdP6egR15w53nYxQxjCZW%2F3y0zq9ETdC50%2BA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-HMAC-SHA256&X-Amz-Date=20230406T000000Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21600&X-Amz-Credential=ASIAYDKQORRYSM476UHB%2F20230406%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=328da2ef0681f7b20f9dead2895ac16d6206f2c677d9e48f9f090db69a8488d9
Step by stepSolved in 5 steps with 3 images
- please may you : create a Python class named Animal with properties for name, age, and a method called speak. also include an initializer method for the class and demonstrate how to create an instance of this class. and extend the Animal class by adding a decorator for one of its properties (e.g., age). please include both a getter and a setter for the property, and demonstrate error handling.arrow_forwardIn JavaScript, how are an object and an interface related to each other? a. The object’s interface consists of the code and data needed for that object. b. An object’s interface is analogous to a pocket calculator’s inner workings. c. Built-in JavaScript objects do not require an interface, but custom objects do. d. An interface allows another program to access an object’s properties and methods.arrow_forward●くろまる • Compile the Automobile.java class and correct any errors. Create another file named TestAutomobile.java that contains the main method. Create several Automobile objects and test that your constructor and methods work as described. ●くろまる Create a UML diagram of the Automobile class. Create the Automobile.java class. It should have the instance variables, constructor(s) and methods located below. Automobile Instance variables Reminder: + indicates public, - indicates private - make (String): The automobile make (Ford, Acura, etc). - model (String): The automobile model (Escapade, ZDX, etc). - power (boolean): Holds the value true if the power is on and false if the power is off. The default value is false. . - gear (char): Holds the value of the gear that the automobile is in. The default value is P (Park). Other values include D (Drive), and R (Reverse). Automobile constructors • One constructor that takes two parameters and sets the make and model instance variables. . - volume (int):...arrow_forward
- Refer to the following interface: Provide two examples (screenshots) that in many ways could improve the above or similar interface using the principles of direct manipulation. Explain the relevant improvements as well. (Examples might have different object, labels and organization)arrow_forwardFor this lab task, you will work with classes and objects. Create a class named text that works similar to the built-in string class. You will need to define a constructor that can be used to initialize objects of this new class with some literal text. Next, define three methods: to_upper() that will convert all characters to uppercase, reverse() that will reverse the text and length() that will return the length of the text. After you have completed this part, copy the following mainfunction to your code and check if the implementation is correct. int main() { text sample = "This is a sample text"; cout << sample.to_upper(); // This should display "THIS IS A SAMPLE TEXT" cout << endl;cout << sample.reverse(); // This should display "txet elpmas a si sihT"cout << endl; cout << sample.length(); // This should display 21 }arrow_forwardBelow for each class you find a UML and description of the public interface. Implementing the public interface as described is madatory. There's freedom on how to implement these classes.The private properties and private methods are under your control.. There are multiple ways of implementing all these classes. Feel free to add private properties and methods. For each object, it's mandatory to create a header file (.h), implementation file (.cpp) and a driver. Blank files are included. The header should have the class definition in it. The implementation file should contain the implementations of the methods laid out in the header fine. And finally the Driver should test/demonstrate all the features of the class. It's best to develop the driver as the class is being written. Check each section to see if there are added additional requirements for the driver. Two test suites are included so that work can be checked. It's important to implement the drivers to test and demonstrate...arrow_forward
- Below for each class you find a UML and description of the public interface. Implementing the public interface as described is madatory. There's freedom on how to implement these classes.The private properties and private methods are under your control.. There are multiple ways of implementing all these classes. Feel free to add private properties and methods. For each object, it's mandatory to create a header file (.h), implementation file (.cpp) and a driver. Blank files are included. The header should have the class definition in it. The implementation file should contain the implementations of the methods laid out in the header fine. And finally the Driver should test/demonstrate all the features of the class. It's best to develop the driver as the class is being written. Check each section to see if there are added additional requirements for the driver. Two test suites are included so that work can be checked. It's important to implement the drivers to test and demonstrate...arrow_forwardCreate a class Course, which has one field: String courseName Create the constructor, accessor, and mutator for the class. Then, in the main method of this class, create an instance of the class with the name "CST1201". Write an equivalent while statement to replace the following for statement for (int i=2; i<100; i=i+2) { System.out.println(i); }arrow_forwardChoose necessary patters, draw the UML and code just company class methods on paper. A car company makes a car produce application. There are diffrerent types of models that the company builds as sedan and sport. Each model has some shared and distinguishing features. The object creation process should conduct by a central class. The second central class should not be created in the application.arrow_forward
- Write a graphical application that contains a class named RV whose objects are the recreational vehicle designed and digitized as described in Knowledge Exercises 20 and 21 (you can design your version as well. Simple car shape is will be appreciated. The class’s private data members should be the vehicle’s body color and (x, y) location. a) Give the UML diagram for the class. It should include a three-parameter constructor, a toString method, a method to input the values of all of an object’s data members, and a show method to draw the RV at its current (x, y) location. b) Progressively implement and test the RV class by adding a method and verifying it before adding the next method. A good order to add the methods to the class is the three-parameter constructor, followed by the toString method, the show method, and finally the inputmethod. The client code should create an RV object using the three-parameter constructor to test all of the methods as they are progressively added to the...arrow_forwardDevelop a set of classes for a college to use in various student service andpersonnel applications. Classes you need to design include the following:• Person—A Person contains a first name, last name, street address, zip code,and phone number. The class also includes a method that sets each datafield, using a series of dialog boxes and a display method that displays all of aPerson’s information on a single line at the command line on the screenarrow_forwardIn Java, please. Complete the Course class by implementing the findStudentHighestGpa() method, which returns the Student object with the highest GPA in the course. Assume that no two students have the same highest GPA. Given classes: Class LabProgram contains the main method for testing the program. Class Course represents a course, which contains an ArrayList of Student objects as a course roster. (Type your code in here.) Class Student represents a classroom student, which has three fields: first name, last name, and GPA. (Hint: getGPA() returns a student's GPA.) Note: For testing purposes, different student values will be used. Ex. For the following students: Henry Nguyen 3.5 Brenda Stern 2.0 Lynda Robison 3.2 Sonya King 3.9 the output is: Top student: Sonya King (GPA: 3.9) LabProgram.java import java.util.Scanner; public class LabProgram { public static void main(String args[]) { Scanner scnr = new Scanner(System.in); Course course = new Course(); int...arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education