Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
IN JAVA
you will implement either the Cat or Dog Java class. Your class must meet all of the specifications from the UML Class diagram. Be sure to include the following in your Cat or Dog class:
- All attributes (variables) with appropriate data types. Note that the types are not specified in this UML class diagram. You will need to think about what the most appropriate data type is for each attribute.
- At least one constructor method that initializes values for all attributes
- Accessors and mutators for all attributes. Each attribute should have a corresponding accessor (“getter”) and mutator (“setter”) method. These methods are indicated in the class diagram.
- In-line comments and appropriate white space, according to the style guidelines you have learned so far in the course
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images
Knowledge Booster
Similar questions
- Solve it according to given instructions and must not use any advance knowledge than metioned methodsarrow_forwardI can make the application but seem to always have issues with the Class UML Diagram. Below is the program I made and I attached the UML diagram. I was not completely sure about the Guest guest1 = new Guest (" ", " ") objects in the UML diagram. Any Advice? //-------------------First class: public class Guest { // Attributes belowprivate String firstName;private String lastName;//constructor belowpublic Guest(String firstName, String lastName) {this.firstName = firstName;this.lastName = lastName;} // Overloaded constructor belowpublic Guest() {this("No First Name Given", "No Last Name Given");} public String getFirstName() {return firstName;} public void setFirstName(String firstName) {this.firstName = firstName;} public String getLastName() {return lastName;} public void setLastName(String lastName) {this.lastName = lastName;} @Overridepublic String toString() {return firstName + " " + lastName;}} //------Second class import java.util.ArrayList; public class GuestList {public…arrow_forwardGiven below is a UML diagram for address class. Address -Street: String -City: String -State: String -Postal code: String -country: String +methods a) Write the code for default constructor and set the values of the data fields to null? b) Write the code for overloaded constructor with formal parameters and set the values of the data fields to the parameter listing. c) Write the code for mutator and accessor methods. d) Write the code for printAddress() method that returns the full address.arrow_forward
- Please help with the following: Consider the following Python code:class MyClass: attr = 10a. "altr" is MyClass's instance attribute.b."attr" is MyClass's static attribute.c."attr" is a non-local variable.d."attr" is a local variable.arrow_forwardYou have to implement program that compares graduate students based on their ranks. The design of the program is given in the following UML diagram: • Student class: Base class that GradStudent extends. • GradStudent class: The objects from this class will be used for comparisons. • Rankable interface: Defines the implementation needed for comparison. GradStudent implements this interface. • Test class will be used to get student information from the user and demonstrate the comparison of students.arrow_forwardWith suitable example, clearly explain the difference between a default constructor and a parameterized constructorarrow_forward
- please do both parts part 1) Implement the Solvable inheritance structure strictly according to its UML diagram.Add comments stating where data fields, constructors, toString(), and other methods are (ifany). Neither method should have an empty body unless abstract methods.Note: You should implement the Solvable interface, abstract class Problem, regular classCodingProblem, and regular class MathProblem. part 2) Write a main() method inside of the CodingProblem class, having the following:1. Generate a random integer from 0 to 100.Hint: int num = (int)(Math.random()*100);2. Create a new instance of the CodingProblem class with random input, a String “Yourlucky number is: yourInputvalue” as output, algorithm, and programmingLanguage.Apply the concept of Polymorphism (means creating the object using the Problemclass name but CodingProbem’s constructer).3. Create a new instance of the MathProblem class with random input, its square(power of 2) as an output, your algorithm, and…arrow_forwardProgramming to be used: Java Instructions: Develop a UML class diagram for the following situations. Your diagram should be able to specify correctly the following: Class Name, Attributes with their corresponding data type and visibility, Methods with their corresponding data type. Use the text editor or MS word to present your answers. Scenarios: 1. The university wants you to design an enrollment system. One of the classes to be considered is class STUDENT. A student during registration can have his ID number. Information about the student (eg. First name, middle name, middle initial, contact number, address, birthday) are asked and stored in the system. These information, however, can be edited. After the registration/admission, a student can enroll subjects, can add subjects and can drop subjects. 2. The same University asks you to design a Human Resource Information System. This is a system that records information and generates reports about the employees in the university. Each…arrow_forwardYou need a method of protecting class fields against unintended corruption.arrow_forward
- If the programmer doesn't declare any constructors for an extended class, what constructors will be inherited from the superclass? How does this inherited constructor initialize new instance variables that are not part of the superclass? Suppose that Vehicle is a class and Car is a new class that extends Vehicle. Write a description of which kind of assignments are permitted between Car and Vehicle variables. Suppose you write a new constructor for an extended class. Describe two different ways that the superclass's instance variables could be initialized within the constructor for the extended class.arrow_forwardFor this problem you are to join the following classes into a hierarchy (use the UML diagrams from Module 2 to get started): Player - Super Class Archer - Subclass Barbarian - Subclass Cleric - Subclass Rogue - Subclass Warlock - Subclass If the parent class has the same attributes as the sub class then you can remove those attributes from the subclass. If the class is new for this module, please come up with 2 unique attributes of your choice, and 1 piece of functionality. If the sub classes are shown on the same level, then they share a parent class.arrow_forwardPlease help me with this using java. Please use comments explaining each line of code. Please complete both part A and Barrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY