Task-02: Implement the following UML class diagram and test the methods. GeometricObject «interface>> +getPerimeter():double +getArea():double Circle #radius:double = 1.0 %3D +Circle(radius:double) +getPerimeter():double +getArea():double Resizable <«interface>> +resize(percent:int) ResizableCircle +ResizableCircle(radius:double) +resize(percent:int)
Q: Question: Implement the following UML class diagrams and test their methods. Shape - dimension1 :…
A: filename Shape.java class Shape { // declaring the dimensions. double dimension1, dimension2;…
Q: 4. Create an interface Wheel with methods setWheels (int c) and getWheels () and a class Vehicle…
A: Solution: Given,
Q: Create a Cycle class, with subclasses Unicycle, Bicycle and Tricycle. Demonstrate that an instance…
A: Code : public class Cycle { public static void main(String[] args) { Cycle[] cycles = new…
Q: Implement any one of the following methods. That will be a good exercise for you if you choose to…
A: Given The answer is given below.
Q: The following is a class definition for a simple Ebook. Two instance variables and one parameterless…
A: Program Approach: Create constructor which takes array of type string as parameter and a string…
Q: FOR JAVA 1. Implement the following classes and interface in Java. Shape interface which has the…
A: GIVEN: FOR JAVA 1. Implement the following classes and interface in Java. Shape interface…
Q: Now we want to create an Object oriented System for a shopping mall. It has Items with name,…
A: Actually, program is a executable software that runs on a computer.
Q: Exercise: Exercises Write a class named Octagon that extends GeometricObject and implements the…
A: The program is written in java
Q: 1. Create a UML diagram for part of the String class by reading the Java API. Your diagram should…
A: There are lot of static methods and instance methods and few of them are represented in class…
Q: Create an interface Wheel with methods setWheels (int c) and getWheels () and a class Vehicle with…
A: Create an interface Wheel with methods setWheels (int c) and getWheels () and a class Vehicle with…
Q: Write the Java code corresponding to the following UML diagram. The class School implements the…
A: Solution: Programming language used: Java Program in Java: (Note: all solution steps are…
Q: MAT-521-Q2 Get the area of the square,circle, triangle and rectangle shapes using abstract classes…
A: let us see the answer:- Create a shape abstract class with two numbers and an empty function called…
Q: Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and…
A: Here, I am giving detailed explanation of the program
Q: In order to implement different ways of discount strategies for an object oriented parking system,…
A: In the above specification the following assumptions are made: CarType is a class which has an…
Q: For the following Pseudocode help me to Design a UML Class Diagram. Thanks! from tkinter import…
A: Diagram:
Q: Implement the Shape hierarchy -- create an abstract class called Shape, which will be the parent…
A: Answer :-
Q: Implements an interface having three methods eat, travel, bark
A: Program Plan: Create an interface named Animal In that interface declare methods…
Q: Write the classes as shown in the following class diagram. Add a tester where you make an array of 5…
A: Java is an object-oriented language, it is used to develop browser applications and mobile…
Q: Extend the ItemToPurchase class to contain a new attribute. item_description (string) - Set to…
A: Actually, given information: Extend the ItemToPurchase class to contain a new attribute.…
Q: Use java programming language 1.1 Create a Student Object project. Create a Student class and use…
A: Student.java =================== import java.util.Random; public class Student { //declare variables…
Q: Please help me design a SimulationProject.cpp in C++. THANK YOU! For this assignment, we will…
A: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib>…
Q: 1. Create a UML diagram for part of the String class by reading the Java API. Your diagram should…
A: Let the private instance variable be values Let the constructors be default and parameterized which…
Q: Assume ContractEmployee, HourlyEmployee, CommissionEmployee, FixSalaryEmployee are sub-classes of…
A: Given question has asked to create a method Static void countAndPrintAllTypesOfEmployee which will…
Q: Write an interface as follows: The interface is named ServiceReminder It has one method named…
A: By default interface contains abstract methods. This means that the body of method is not provided…
Q: INTRO JAVA Make a class Employee with a name and salary. Make a class Manager that inherits from…
A: class Employee{String name;double salary;void tostring(){System.out.println("Employee:\nName:…
Q: Design a class Cannonba ll to model a cannonball that is fired into the air. A ball has • An x- and…
A: Program: Filename: “Cannonball.java” // Define a class Cannonball that simulates a cannonball firing…
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: The Java feature in Q1 which create a new version of predefined method getPerimeter() is called…
A: ANSWER:- Polymorphism
Q: Q1: Write the Java code corresponding to the following UML diagram. The class School implements the…
A: Solution: Given,
Q: Assume the existence of a Widget class that implements the Comparable interface and thus has a…
A: Using binary search for the effective implementation of the getWidgetMatch(given in the question).…
Q: Implement the following UML class diagrams. Create two objects of PartTimeEmployee and…
A:
Q: Implement the following classes: Polygon numSide: int /* constructor */ /* accessor-mutator */ +…
A: Note: Programming language is missing in the question. So we will answer this program in Java. If…
Q: 3. The interface Range is defined below: public interface Range { void setLimits(int x, int y);…
A: According to the information given:- We hvae to follow the instruction and create the interface…
Q: You are given the definition of a base class named as Polygon. A polygon is a closed figure with…
A: Actually, program is a executable software that runs on a computer.
Q: Q1. The following class models a linear equation. Implement a getValue() method for the class, which…
A: Here I have given the main function for testing. Algorithm : Step 1 : define public class Line.…
Q: SOLVE WITH JAVA Q#1: Write the class Student having attributes name (String), age (int) and…
A: Program: import java.io.*;class Student{ int rollno; String name; int number_of_subjects;…
Q: please solve in python languange and use proper comments for better understanding . Thank you.
A: Given python code
Q: Write the Java code corresponding to the following UML diagram. The class School implements the…
A: Q: Implement Java interface and OOP for give problem
Q: Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and…
A: public abstract class NewspaperSubscription{ protected String name; protected String address;…
Q: Define a Polygon interface that has methods area() and perimeter(). Then implement classes for…
A: I attached the working code below, Please go through that code.
Q: Implement the above system using inheritance in the best possible way. Keep every object size as…
A: The given system of classes for inheritance are implemented as follows: Class Region acts is…
Q: Java program * Interfaces 1. Modify the class Rectangle to implement the Comparable interface, as…
A: public class Rectangle implements Comparable<Rectangle>{ double width=1; double height=1;…
Q: Implement the Shape hierarchy -- create an abstract class called Shape, which will be the parent…
A: Here I have different classes as per the question. Shape class contains one abstract method…
Q: Create abstract class Ticket, and classes TrainTicket and PlaneTicket. Define all attributes and…
A: We need to implement the : Ticket.java TrainTicket.java PlaneTicket.java as per the given…
Q: The interface Range is defined below: public interface Range { void setLimits(int x, int y); int…
A: Here I have created a class named RandomInteger that implements the interface Range. In this class,…
Q: Define a class named ComparableCirclethat extends Circle and implements Comparable. Draw the UML…
A: UML stands for Unified modeling language. The tool which is used draws the class diagram and…
Q: Use Netbeans to run the following decorator pattern code. Provide screenshot to prove that the code…
A: The given program cannot be executed as it does not contain the "main()" method like "public static…
Q: Implement the following classes and interface in Java. • Shape interface which has the following…
A: public interface Shape { //interface declaration //declaring methods public double perimeter();…
Q: Question: Implement the following UML class diagrams and test their methods. Shape - dimension1 :…
A: Inheritance is an object oriented feature that allow a class to inherit the feature of another…
write this java code
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- using python language Suppose a call center has three levels of employees—respondent, manager, and director. An incoming telephone call must first be allocated to a respondent who is free. If the respondent cannot handle the call, the call must be escalated to a manager. If the manager is occupied, then the call should be escalated to a director. Design your own classes and data structures for this problem. Implement a method dispatchCall() that assigns a call to the first available employee.Use java programming language 1.1 Create a Student Object project. Create a Student class and use the provided UML diagram to code the instance fields, constructors and methods. Note: The module mark is the average of the participation mark and the examination mark - calculate this using the calcModuleMark() method. The determineStNumber() method should compile a student number with the first 3 letters of the student's name, a '#' symbol, and a 3-digit randomly generated number (make use of a for-loop to concatenate these 3-digits). The stNumber data field should be set in the constructor by calling the determineStNumber() method. The toString() method must compile a string to display the student number, participation mark, examination mark, and module mark, formatted in table format. Student number PMark EMark MMark Mar#9186 81 64 72.00 1.2 Create a testStudents class. Do the following: -Write a static method called display() which receives…Using python: Suppose a call center has three levels of employees—respondent, manager, and director. An incoming telephone call must first be allocated to a respondent who is free. If the respondent cannot handle the call, the call must be escalated to a manager. If the manager is occupied, then the call should be escalated to a director. Design YOUR OWN classes and data structures for this problem. Implement a method dispatchCall() that assigns a call to the first available employee.
- Q2: Write the Java code corresponding to the following UML diagram. Then, create two objects from the main method and print their areas and perimeters. Polygon {abstract} # color: String # numberOfSides: int + Shape() + Shape(color:String, numberOfSides:int) + getColor(): String + setColor(color:String): void + getNumberOfSides(): int + setNumberOfSides(sides:int): +abstract getArea(): double +abstract getPerimeter(): double Triangle - sides: int[ ] + Triangle(color:String, numberOfSides:int) + addSide(index:int, sideValue: int): void + getSide(index:int): int + getArea(): double + getPerimeter(): doubleShape -width: double -length: double +allmutatorMethods Shapes2D Shapes3D -height:double *calSize():double +calVolume():double 1. Define class Shape, 2DShape and 3DShape as per UML class diagram given. 2. Define all mutator methods(set and get) for all classes. 3. Define methods calArea() with formula area - width * length for 2DShapes. 4. Define methods calArea() with formula calvolume, volume = width*length*height for 3DShapes. In the main program, declare and set data in 1 object of 3DShapes. Create an array OR ArrayList of 2DShapes, set and display the info of all objects as shown in the output. 5.Implement the following UML class diagrams. Create two objects of PartTimeEmployee and FullITimeEmployee. Then call the toString() and salary() methods to show the details and their salary respectively. For PartTimeEmployee: hours is the total hours employee worked, i.e. 20 rate is the per hour rate, i.e. 80 So, salary = 20*80 = 1600 For FullTimeEmployee: basic is the base salary, i.e. 15000 Allowance is usually provided as percentage, i.e. 25% So, total salary = 15000 + 25% of 15000 = 18750 Person Employee - name: String - age: int - address: String - department: String - designation: String + Person(name: String, age: int, address: String) * getters - setters / + printPerson(: String + Employee(name: String, age: int, address: String, department: String, designation: String) * getters - setters / + printEmployee): String PartTimeEmployee FulITimeEmployee - basic: double - allowance: double - hours: double - rate: double + PartTimeEmployee(name: String, age: int, address: String,…
- The interface Range is defined below:public interface Range{ void setLimits(int x, int y); int getNumber();}Implementations of Range should exhibit the following behaviour:• The setLimits method should store its parameter values somewhere to serve as the lower and upper limits of the range appropriately.• A call to getValue should return an integer that is always greater than or equal to the lower limit and less than or equal to the upper limit.The class RandomInteger is an implementation of the interface Range. It also has the following features:• It has two fields of int type, low and high, to record the lower and upper limits of the range, respectively.• It has single constructor method that takes two integers and stores them in the appropriate fields. Note: You should make use of the setLimits method.• A call to the method getNumber should return a random number that is always within the range, i.e. greater than or equal to the lower limit and less than or equal to the upper limit.…Create an interface Wheel with methods setWheels (int c) and getWheels () and a class Vehicle with abstract methods getColor () and getBrand (). Now, create a concrete class Taxi with additional method setDriver (String name) that inherits both Wheel and Vehicle. (Note: Concrete classes don’t have any abstract method)Design and implement a Java class named Book with two data members: title and price. The class should have suitable constructors, get/set methods, and the toString method. Design and implement another Java class named BookShelf which has an ArrayList data member named bookList to store books. The class should have suitable constructors, get/set methods, and the toString method, as well as methods for people to add a book (prototype: addBook(Book book)), remove a book (prototype: removeBook(Book book)), and search for a book (prototype: findBook(Book book)). Test the two classes by creating a Bookshelf object and five Book objects. Add the books to the bookshelf. Display the contents of the bookshelf. Test the removeBook and findBook methods as well. Take screenshots of your tests and submit them with your Java code (not the whole project)
- Q1: Write the Java code corresponding to the following UML diagram. The class School implements the interface Building. The method computeArea returns the area of the building as width * length. After that, add a testing class with a main method which defines an arrayList that contains three objects. From the main method, print the area of all the three objects.Suppose a call center has three levels of employees: respondent, manager, and director. An incoming telephone call must first be allocated to a respondent who is free. If the respondent cannot handle the call, the call must be escalated to a manager. If the manager is occupied, then the call should be escalated to a director. Design YOUR OWN classes and data structures for this problem. Implement a method dispatchCall() that assigns a call to the first available employee.Part I: Implement the following classes Consider the following UML diagram for an application that manages spheres in the 3D space. Sphere Point -radius: double -X: double -y: double z: double +Point( ) +Point(x: double, y: double, z: double) +calculateDistance(point :Point) :double +isEqual(point : Point) :boolean +toString(): String -center: Point -color: String +Sphere( ) +Sphere (radius: double, center: Point, color: String) +getCenter( ):Point +calculateVolume(): double +isEqual(sphere:Shpere):boolean +toString(): String Question 1: Create the class Point Implement the no-arg and all-arg constructors. Implement the calculateDistance method that returns the distance between two points. Implement the isEqual method that returns true if all coordinates are equal in both points and false otherwise. Implement the tostring () method. If x-2.0, y-3.5, and z-4.0, then the method returns a string in the form: (2.0, 3.5, 4.0) Question 2: Create the class Sphere Implement the two…