Create an abstract class named Shapes. The Shapes class has only the calcArea() method. From Shapes, create three derived classes named Circle, Square and RightTriangle. Each of the three should have data members used to calculate the area of its shape. Define the method calcArea() for each of the three shapes. Each of the three shapes should also have appropriate constructors.
Q: Tableau Question: Your dashboard works well on small screens. What else is guaranteed to work well…
A: Your dashboard works well on small screens. What else is guaranteed to work well when this dashboard…
Q: In the event of software or program malfunction, it is crucial to consider the various responses…
A: Introduction: Any portable computer may be referred to by this term; they are designed to be tiny…
Q: 5) This HTML attribute/value is added to an a (anchor) element (along with a href attribute) to make…
A: As we know Anchor tag is an HTML element that creates a link to a target URL in it Anchor tag…
Q: What are the features provided by layering?
A: Answer is
Q: input parameters when called. Here, d is a dictionary, k is a key and vis a value. function will add…
A: Algorithm for the code : 1. Start2. Create a dictionary d.3. Initialize key 'A' with value 1 in…
Q: Explain procedural and structural software Design Methods
A: Procedural design: Procedural Design (SPD), a method of software design, transforms and translates…
Q: Explain Twisted pair (TP).
A:
Q: 4.- Suppose you have an object made up of two w-bit integers, x and y, ie. z=xy. Show why x y does…
A: solution: A good hash function is one that helps them reduce space rather than making more of it…
Q: How to Create a Binary File using python?
A: Write Bytes to File in Python To permanently store data, files are utilised. File handling involves…
Q: What Is Meant By Asymmetric Multiprocessing?
A: The solution is given below for the above given question:
Q: download system which includes following features: Search, music selection, payment for music…
A: Data flow diagram is a diagram which visually shows how data flows in a system. It depicts how data…
Q: Discuss advantages and Disadvantages of star Topology.
A: We need to discuss advantages and disadvantages of star topology.
Q: operating
A: Operation system: It is the process of controlling all these other application programs in a PC…
Q: Your task is solve the Question 1 and Question 2 from this:-…
A: Required: Your task is to solve Question 1 and Question 2 from this:-…
Q: Functions and Prototypes - Converting Temperatures In this exercise you will create a program that…
A: Algorithm of the code:- Step 1: Start Step 2: Declare variables Double fahrenheit_temperature,…
Q: QObject class is a simplified application of the composite pattern because it plays the role of all…
A: The QObject class is a simplified application of the composite pattern because it plays the role of…
Q: Prove the following logical implication (A ⇒ B) ⇒ ((C ⇒ A) ⇒ (C ⇒ B)) without a truth table
A: This is very simple. (A ⇒ B) ⇒ ((C ⇒ A) ⇒ (C ⇒ B)) (F ⇒ F) ⇒ ((F ⇒ F) ⇒ (F ⇒ F)) (F ∧ F) ⇒ ((F ∧ F)…
Q: Explain procedural and structural software Design Methods
A: Program Design Software design is a process that converts user requirements into a useful form,…
Q: Hash Function Encryption x1 = L8(h(KAB)) What does the 8 represent in L8....
A: The question has been answered in step2
Q: Prove that for n = 2, H(X) is maximal when p₁ = P₂ = 1/2.
A: Given that , n=2 We need to prove H(X) is maximal when p1=p2=1/2
Q: 1- Design a web page that contains these items: a. Title: "End Term Exam " b. Header: " Contents "…
A:
Q: In Java, please don't modify only fill in the code where it says "/* Define your methods here. */"…
A: The JAVA code is given below with output screenshot
Q: What are the requirement for computer Network.
A:
Q: Explain the components of data communication.
A: Data communication. It is understood to be the exchange of information between two devices using a…
Q: Explain Twisted pair (TP).
A: Twisted pair cables are the cables used for many types of communication which have two conductors in…
Q: Define what is ascending node and descending node.
A:
Q: Write a class Cylinder that contains information about a cylindrical object. The Cylinder class must…
A: The complete python code is below:
Q: Examine how other computer and mobile app users have dealt with problems in the past so that you can…
A: Introduction: Examples of situations when people respond to software problems include the following:…
Q: What are the limitations of FDMA-satellite access?
A: Definition: Inter modulation distortion at the transponder is a possibility since several…
Q: of
A: Dear Student, The C/C++ code that defines a structure data type and uses the dot notation and later…
Q: Explain What is Ring Topology?
A:
Q: import java.util.*; public class BSTChecker { public static Node checkBSTValidity (Node rootNode) {…
A: Binary search tree: A binary Search Tree is a data structure that is based on a binary tree and is…
Q: What are the two interfaces provided by protocols?
A: Introduction In this question we are asked about the two interface provided by protocols.
Q: Create 2x3 matrix. Perform each of following statements using "loops" with "if" statements if…
A: Introduction: In this question, we are asked to write a program to perform two task in the 2D…
Q: Your task is to create a Node class and after that make a linkedlist from that and add data to it…
A: An application that builds a single linked list of n nodes and counts them Explanation To count the…
Q: what happens and how it's done when people do illegal things on the internet. How do you avoid…
A: Definition: Networks and computers are used in cybercrime. It's possible that a crime was carried…
Q: What are the two interfaces provided by protocols?
A: Definition: Service interface defines local protocol operations. Peer interface determines the form…
Q: How are WLANS Different.
A: Please find the answer below :
Q: What are the two interfaces provided by protocols?
A: Definition: The operations that local objects can carry out on the protocol are specified by the…
Q: What is the role of designing in any system or projec implementation?
A: Please find the answer below :
Q: Give an example why does ClassNotFoundException and InterruptedException occur? Java
A: Answer:
Q: How are WLANS Different.
A:
Q: The first path from start vertex s to goal vertex r found by monotonic Algorithm A* is optimal.
A: Definition: Find the shortest route between the provided source vertex (s) and the specified…
Q: Write a class called Pet, that has two String instance variables, called name and voice. The class…
A: Pet(String name, String voice) // is a constructor method speak()// it is a default method loop…
Q: Write a denotational semantics mapping function for the following statements: a. Ada for b. Java…
A: Introduction The Environment parameter has been added, and functions that give meaning to Blocks and…
Q: Would you help me with the last 2 phases please because I am a bit lost when it comes to coding this…
A: The code for the last 2 phases are given in the next steps.
Q: Hi! given the following Boolean Expression: x'y + y'z Find the standard disjunctive normal form and…
A: Hi! given the following Boolean Expression: x'y + y'z Find the standard disjunctive normal form and…
Q: Question 1: Write a complete Java program - with your own code writing - that contains: 1. A main…
A: I have provided a solution for Q1 of Part1)----- I have provided JAVA CODE along with CODE…
Q: 1.- A certain university assigns each of its students student numbers the first time they register…
A: Given: 1.- A certain university assigns each of its students student numbers the first time they…
Q: Write a program that has a function vowelCount() that accepts a character array and counts the…
A: code : - import java.util.Scanner; public class Main{ // method to count the vowel in char…
This is a polymorphism assignment I can't seem to figure out for Java
Create an abstract class named Shapes. The Shapes class has only the calcArea() method.
From Shapes, create three derived classes named Circle, Square and RightTriangle.
Each of the three should have data members used to calculate the area of its shape. Define the method calcArea() for each of the three shapes. Each of the three shapes should also have appropriate constructors.
Not required, but create a class with the main() method to test the classes created above.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- 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…I need help in improving my Elevator class and it's subclasses code. I already provided my code at the bottom. This is an elevator simulator that uses polymorphism and object-oriented programming to simulate the movement of elevators in a building with multiple types of passengers and elevators. There are 4 types of elevators in the system:StandardElevator: This is the most common type of elevator and has a request percentage of 70%. Standard elevators have a maximum capacity of 10 passengers.ExpressElevator: This type of elevator has a request percentage of 20%. Express elevators have a maximum capacity of 8 passengers and are faster than standard elevators.FreightElevator: This type of elevator has a request percentage of 5%. Freight elevators have a maximum capacity of 5 passengers and are designed to transport heavy items.GlassElevator: This type of elevator has a request percentage of 5%. Glass elevators have a maximum capacity of 6 passengers and are designed to transport fragile…I need help in improving my Elevator class and it's subclasses code. I already provided my code at the bottom. This is an elevator simulator that uses polymorphism and object-oriented programming to simulate the movement of elevators in a building with multiple types of passengers and elevators. There are 4 types of elevators in the system:StandardElevator: This is the most common type of elevator and has a request percentage of 70%. Standard elevators have a maximum capacity of 10 passengers.ExpressElevator: This type of elevator has a request percentage of 20%. Express elevators have a maximum capacity of 8 passengers and are faster than standard elevators.FreightElevator: This type of elevator has a request percentage of 5%. Freight elevators have a maximum capacity of 5 passengers and are designed to transport heavy items.GlassElevator: This type of elevator has a request percentage of 5%. Glass elevators have a maximum capacity of 6 passengers and are designed to transport fragile…
- Create a Right Triangle class that has two sides. Name your class rightTraingle. Code getter and setters for the base and the height. (Remember class variables are private.) The class should include a two-argument constructor that allows the program to set the base and height. The constructor should verify that all the dimensions are greater than 0. before assigning the values to the private data members. If a side is not greater than zero, set the value to -1. The class also should include two value-returning methods. One value-returning method should calculate the area of a triangle, and the other should calculate the perimeter of a triangle. If either side is -1, these functions return a -1. The formula for calculating the area of a triangle is 1/2 * b*h, where b is the base and h is the height. The formula for calculating the perimeter of a triangle is b+h+sqrt (b*b+h*h). Be sure to include a default constructor that initializes the variables of the base, height to -1. To test…The class "Car" has the following attributes: plate (String), mark (String), model (String), year (int), km (int).Write a constructor method for the "Car" class that takes values as parameters for all these attributes.JAVA A company needs to develop an object-oriented library with a few Java classes forthe following task. Overall, they want the classes to model the geometric shapes and calculatetheir areas. These geometric shapes include Square, Rectangle, Circle, and Triangle.The above four shapes share common attributes such as name and color. The area of a shapecan be calculated by using a method area( ) which can be implemented only until the exactshape is known. Different shapes need a different area( ) method.1) Design a Java abstract class called Shape to model this situation, which will serve as a parentclass. Write its code;2). All the above shapes should be drawable by the users by calling the draw( ) method.Different shapes are drawn differently. You should design a Java interface named Drawableto provide this method for the shape classes to implement in their own ways. Write its code;3). Write the code for the four classes: Square, Rectangle, Circle, and Triangle.Note:• You should decide…
- Write a shoe class with the following attributes: color (e.g., "blue", "green", "orange") displayName (e.g., "nikes, adidas", "puma") price (e.g., 100, 200,60) Include only one constructor. It should have parameters for each of the attributes and set their values. Additionally, include getters and setters for each of the attributes. Add a driver, name it Purchases, and create 2 objects. Finally, print out some information about both objects (i.e., print the information from some or all of the getters). For example, if you created a shoe object whose color was blue, whose display name was shoes , for a price of 230, you could use the getters to print something like this:These work trousers are blue and cost $230A. Writing an Interface In this problem you will first write an interface and then modify classes to implement the interface. Write an interface, GeometricSolid, which has one method, volume. The volume method takes no arguments and returns a double. You are provided with three classes: Cylinder, Sphere, and RightCircularCone Modify the classes so that they implement the GeometricSolid interface. Supply the appropriate method for each class. You can use Google search to find the formula for the volume. Make sure that you use Math.PI in your calculations. Notice in InterfaceRunner that the objects are added to an ArrayList of GeometricSolids. since I couldn't fit all images with two screen shots I left the link here link: https://codecheck.it/files/18040616319p6jy6gzkdzuq08nmlp81251tPlease do it in JavaScript or C# 1) Design and implement the class structure for a drawing application. A drawing is made up of a canvas that contains a collection of three different shapes: circles, lines, and boxes. Each shape can be drawn by calling a Draw() method for that shape. The canvas class should also have a draw method that draws all of the shapes it contains. You don’t have to actually draw anything on a screen; you can simulate drawing by writing a message to the console.For example, the code snippet: canvas.Draw();Drawing a circle at...Drawing a line at...etc. (For each shape on the canvas) 2)(Bonus) Consider re-writing the above answer (#1) differently where the canvas does not contain the shapes, but is able to draw any of the three shapes passed to it. Re-design canvas.Draw() if you need to. Your main() program should ask for user input on what shape to draw. Ask once, draw, then exit.could produce something like the following output to the console:
- Create an abstract class named Element that holds properties of elements,including their symbol, atomic number, and atomic weight. Include aconstructor that requires values for all three properties and a get method for each value. (For example, the symbol for carbon is C, its atomic number is 6, and its atomic weight is 12.01. You can find these values by reading a periodic table in a chemistry reference or by searching the Internet.) Also include an abstract method named describeElement(). Create two extended classes named MetalElement and NonMetalElement. Each contains a describeElement() method that displays the details of the element and a brief explanation of the properties of the element type. For example, metals are good conductors of electricity, while nonmetals are poor conductorsHelp, I making a elevator simulator. I have to use polymorphism and object oriented programming to write this code. Can someone please help me improve this code I have. The remaining code is in the pictures. Any help is appreciated. Thank You! The simulation should have 4 types of Passengers: Standard: This is the most common type of passenger and has a request percentage of 70%. Standard passengers have no special requirements. VIP: This type of passenger has a request percentage of 10%. VIP passengers are given priority and are more likely to be picked up by express elevators. Freight: This type of passenger has a request percentage of 15%. Freight passengers have large items that need to be transported and are more likely to be picked up by freight elevators. Glass: This type of passenger has a request percentage of 5%. Glass passengers have fragile items that need to be transported and are more likely to be picked up by glass elevators. The simulation should also have 4 types…Java Object Oriented Programming Create a Shape class that shall have color and filled instance variables of enum Color and boolean type. The filled boolean variable shall show, whether the shape is filled (colored). The enum Color shall be defined within the class having 4 color names (choose any four). Also define getArea and getPerimeter method in Shape class, both shall return 0. Create Rectangle class with length and width attributes and a Circle class with radius attribute, of type double. Properly encapsulate all fields. Circle and Rectangle shall extend Shape class and override getArea and getPerimters methods as per its type and specific formula. In Test class, create an object of Rectangle and Circle, by initializing all attributes in constructor and print both shapes' area and perimters. In Test class, define a static method with following signature, public static void printEachShapeCount(Shape... shapes) As you know, the parent type variable can hold the…