Create two classes: Rectangle and Cuboid. Cuboid is a child class for rectangle Rectangle - length: double - width: double + Rectangle() +Rectangle(int length, int width) //Accessor and Mutator methods + calculateArea(): double +calculatePerimeter(): double + tostring(): String Cuboid - height: double + Cuboid() +Rectangle(int length, int width, int height) //Accessor and Mutator methods + calculateArea(): double +calculatePerimeter(): double + tostring(): String
Q: C++ programming Question. find the most probable speed from the velocities of ten particles(in m/s) ...
A: The answer as follows
Q: QI Write program in fortran to find the maximum number of (x,y,z)?
A:
Q: Given an interface for LinkedList - Without using the java collections interface (ie do not import j...
A: In Java, a LinkedList is a data structure that stores elements in a non-contiguous location. It is a...
Q: ElectionResults java
A: ElectionResults java
Q: A GSM syatem uses 124 channels and each channel in divided into 8 time slots. What is fhe maximum nu...
A: Given :- A GSM SYSTEM USES 124 channels and each channel is divided into 8 time slots. what is the m...
Q: Hello. I'd like to solve this problem by Python. Implement modified Gram-Schmidt QR-factorization. ...
A: Input : Input the matrix A Output : Output the matrix Q R
Q: Load & check the data: breat_cancer dataset 8. Split your data into train 80% train and 20% test, us...
A: Here is the code: from sklearn.datasets import load_breast_cancer # 1. Load the data into a pandas d...
Q: m to model the information needs listed in each task. The HR office also keeps track of its employe...
A: Lets see the solution.
Q: Provide an example of attribute disclosure from a k-anonymous dataset (
A: Provide an example of attribute disclosure from a k-anonymous dataset (start with a k-anonymous da...
Q: Write a Java program to calculate the RMS velocity of oxygen molecule at 27deg C.
A: public class Main{ public static void main(String[] args) { /* RMS velocity = √3RT/M ...
Q: Find the terms of use for the whole world band at www.wholeworldband.com/about. Take a look at the s...
A: Check further steps for the answer :
Q: Find the computational complexity of the following piece of code
A: The computational complexity of the following piece of code is O(n2).
Q: Although it will no longer be used, please leave the earlier global variable with the initialized da...
A: Clarification:-Here I have made the capacity named readEmployee(), inside the capacity I have taken ...
Q: Using C++, code the following problem: In this problem, we are given a knapsack of fixed capacity C...
A: the answer is given below:-
Q: Translate the following C code to MIPS. Assume that the variables i and j are assigned to registers ...
A: sll $t0, $s3, 2 # $t0 = 4* i as its 4 byte word sll $t1, $s4, 2 # $t1 = 4*j, as its 4 byt...
Q: Assume you are a manager at a Pizza store. Daily you receive several orders across the city. You ide...
A: Calculate the arithmetic mean of each bin and replace each of the values in each bin with the arithm...
Q: Construct a 5 x 32 decoder with four 3 x 8 decoder and 2 x 4 decoder. Use a block diagram constructi...
A: construct 5x32 decoders by using four 3x8 and one 2x4 decoder
Q: If you were reverse engineering NTDLL.DLL, why would you look for binaries that use it?
A: If you were reverse engineering NTDLL.DLL, why would you look for binaries that use it?
Q: Try to find the most probable speed from the velocities of ten particles(in m/s) which are entered b...
A: #include <iostream> using namespace std; int main(){ int velocities[10]; int sum=0; ...
Q: Design and implement a Java program that prompts the user to enter 2 numbers of type int then displa...
A: ANSWER--- import java.util.*;public class Main{ public static void main(String[] args) { Scanner...
Q: Encode õevõpov with Huffman coding.. a. List all symbols and their probabilities b. Find the Huffman...
A:
Q: Complete the below function in Java String method(String str, String x , int y )}{ lladds the x stri...
A: Your java program is given below with an output.
Q: Mom, Dad, Baby, Student, Teacher, and Guide are lining up next to each other in six linear spots lab...
A: Step-1 Below i have answered
Q: a) describe the deadlock detection technique in brief b) explain deadlock prevention concept c) de...
A: Answer a). A deadlock exists in the system if and only if the wait-for graph contains a cycle. To de...
Q: The MIPS assembly instructions that implement the pseudo instruction li $s0,0×0AAC8009 to load 32 bi...
A: Ans:- option 1 is correct
Q: Let S = (a1a2; : : : an) be a sequence of integers. Design an algorithm to nd the subsequence SM = ...
A: Maximum sum subsequence of the array is required which contains consecutive elements. In simple word...
Q: Question 5 In a doubly linked structure, the first and last item have an empty link. O True O False
A: Doubly Linked list is a bidirectional navigation list that is it is possible to navigate both the wa...
Q: QI Write program in fortran to find the maximum number of (x,y,z)?
A: Fortran is suited for numeric computation and scientific computing. It was originally developed by I...
Q: create a table name flovors with columns itemcode (Int), ItemDesc (varchar), and Price (float)
A: We need to write a SQL query to create a table named "flovors" with columns as follows- itemCode (...
Q: C++ programming Question. Try to find the average speed from the velocities of ten particles(in m/s)...
A: Average Speed = Sum of Velocities / Total number of velocity
Q: Exercise-5: S- AbA A → Aa ɛ ->
A: Converted from context-free grammar to Chomsky's normal form
Q: I want to know how to write a program that calculates the average of the following number: 10 , 100...
A: A million instructions per second is an approximate measure of a computer's raw processing power. MI...
Q: Question 4. Construct a regular expression that represents the same language as the automaton below....
A: Please check the step 2 for solution
Q: Draw the logical diagram of a 2-line to 4 - line decoder using NOR gates only.
A: NOR gate in the digital electronics is the gate which is a NOT-OR gate, It is a logic gate which hel...
Q: C++ programming Question. Try to find the most probable speed from the velocities of ten particles(i...
A: Required:- C++ programming Question.Try to find the most probable speed...
Q: Which of the following is equivalent to ¬p→(q→r)? 1. q→(q∧r) 2. (p∨q)→r 3. q→(p∨r) 4. (p∧q)→r
A: We know that q->r = ¬qvr So, ¬p→(q→r) = ¬p→(¬qvr) = p∨(¬q∨r) = (p∨¬q)vr
Q: Write a program that will prompt the user to enter a sentence (string data), read that entire senten...
A: Since the programming language is not mentioned I have used the C++ programming language. Requiremen...
Q: a) Assume a= 10, b-25 and c-15 solve and find the output of each of the following: x-b&c. (2) x-a^c....
A: Bitwise Operators: & (Bitwise AND Operator): Sets output bit to 1 if both bits are 1 Example: 10...
Q: Give five (5) words which can explain the concept “PREPAREDNES” and design your own concept web. Aft...
A: Catastrophe preparations: Finding, measuring, and managing associated with disasters. If you're buil...
Q: How a computer virus that infects executables could add itself to it. What modifications to the exec...
A: When a harmful piece of computer code is used to infect other computers, it is known as a computer v...
Q: Given a hard drive with the following characteristics: 1024 B sector 15,000rpm 4 ms average seek tim...
A: The rotational speed is 15000 rpm That is, 15000 rotation 60 second 1 rotation x seco...
Q: Consider the following AND/OR graph to describe a simple automobile diagnostic system using IF-THEN ...
A:
Q: A. What has to be done if there is any change in the environment properties for a simple reflex agen...
A: As per company guidelines ,we are restricted to answer 1st part ,please post other parts as differen...
Q: How does a connection-oriented transport protocol deal with delayed messages?
A: Actually, this is a connection-oriented transport protocol so that's why we must choose TCP(Transpor...
Q: C++ programming Question. Try to find the average speed from the velocities of ten particles(in m/s)...
A: Required:- C++ programming Question.Try to find the average speed from the velocities...
Q: Part 1 1. Write a permutation of 9 integers which is not in sorted order. Sort the integers using th...
A:
Q: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimen (5x5) using the R...
A:
Q: As a forensic investigator, you need to create a process to: Minimize paperwork. Satisfy...
A: Forensic process: The forensic process must preserve the “crime scene” and the evidence in order to ...
Q: Exercise-4: S- BAB | AВА| В |€ B→ 00 | ɛ
A: Converted from context-free grammar to Chomsky's normal form
Q: 7. Use alphabetical order to construct a binary search tree for the words in the phrase, "Success is...
A: To construct a binary search tree you need to follow some properties of Binary search tree :- In bi...
In Java and dont just copy it and paste in paragraph form. It needs to be formatted how in would look if you're coding it.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- please modify this: display method must call displayNormal Window class abstract class Window implements GUIComponent {private int height, width;private boolean isThisVisible, minimized; public Window(int width, int height){this.height = height;this.width = width;} public int getHeight() {return height; } public int getWidth() {return width; } public String toString() { return "a " + width + "x" + height + " minimal window"; }public void resize(int width, int height){this.width = width;this.height = height;}public void display() {if (!isThisVisible) {System.out.println("(Nothing to see here)");}else if (!minimized) { System.out.println(".......................\n:" + toString() + ":\n.......................");} else {System.out.println("[" + this.toString() + " (minimized)]");} }public void minimize(){ minimized = true;} public void setVisible(boolean isThisVisible) { this.isThisVisible = isThisVisible; }public void restore(){ minimized=false;} public boolean isVisible() { return…Create a RightTriangle class given the following design: RightTriangle variables: base, height methods: 2 constructors, 1 that set default values and another that accepts to parameters. setBase - changes the base. Requires one parameter for base. setHeight - changes the height. Requires one parameter for height. getBase - returns the triangle base. getHeight - returns the triangle height. area - returns the area of the triangle (1/2bh) given the current base and heightJAVA – color: String – make: String – model: String – msrp: double + Car() + Car(color: String, make: String, model: String, msrp: double) + getColor() : String + setColor(color : String ) : void + getMake() : String + setMake(make: String ) : void + getModel() : String + setModel(model: String ) : void + getMsrp () : double + setMsrp(msrp: double) : void + toString(): String The Car class will have four attributes/instance variables/fields and 11 methods. CarDealership Class The CarDealership class will simulate a real life automotive dealership. This class will create 3 Car objects and store them in an array named Lot. The class will then display all of the information pertaining to each car (color, make, model, etc.) to the User and allow the User to select one to purchase. Once the User selects a car to purchase, the Car object should be removed from the array (Lot) and another Car object should be put in its place.
- Exercise 2: The intersection method computes the intersection of two rectangles- that is, the rectangle that would be formed by two overlapping rectangles if they were drawn, as shown at right. You call this method as follows: Rectangle r3 = r1.intersection (r2); Write a program IntersectionPrinter that constructs two rectangle objects, prints them as described in Exercise 1, and then prints the rectangle Intersection object that describes the intersection. Then the program should print the result of the intersection method when the rectangles do not overlap. Add a comment to your program that explains how you can tell whether the resulting rectangle is empty. The random class implements a random number generator, which produces sequences of numbers that appear to be random. To generate random integers, you construct an object of the Random class, and then apply the nextInt (50) gives you a random number between 0 and 49. Use the Random class to construct the two rectangle objects.public class DebugBox { privateint width; privateint length; privateint height; publicDebugBox() { length = 1; width = 1; height = 1; } publicDebugBox(intwidth,intlength,intheight) { width = width; length = length; height = height; } publicvoidshowData() { System.out.println("Width: " + width + "Length: " + length + "Height: "+ height); } publicdoublegetVolume() { double vol = length * width * height; return vol; } } // This class uses a DebugBox class to instantiate two Box objects public class DebugFour3 { publicstaticvoidmain(Stringargs[]) { int width =12, length = 10, height = 8; DebugBox box1 =newDebugBox(); DebugBox box2 =newDebugBox(width, length, height); System.out.println("The dimensions of the first box are"); box1.showData(); System.out.print("The volume of the first box is "); showVolume(box1); System.out.println("The dimensions of the second box are"); box2.showData(); System.out.print("The volume of the second box is "); showVolume(box2); }…Java Write a class called YourFirstNameLine that represents a line segment between two Points. Your Line objects should have the following methods: - public YourFirstNameLine (Point p1, Point P2): construct a new Line that contains the given two Points - public Point getStartPoint(): return this Line’s first endpoint - public Point getEndPoint(): return this Line’s second endpoint - public String toString(): return a String representation of this Line, such as “[(2,3), (4,7)]” - public double getSlope(): return the slope of this Line. The slope of a line between points (x1, y1) and (x2, y2) is equal to (y2-y1)/(x2-x1). If x2 equals x1, the denominator is zero and the slope is undefined, so you may return a zero in this case - public void draw (Graphics g): draw a line in a DrawingPanel. Write a client class called YourFirstNameLineTest with main method to test your Line class. In the main method, you need create a line object with the last four numbers of your Panther ID. For example,…
- this is given code ShapeLab.py # create classes here and their methods def main(): win = GraphWin("Shape Test", 600, 600) l1 = Line(Point(300, 0), Point(300, 600)) l2 = Line(Point(0, 300), Point(600, 300)) l1.draw(win) l2.draw(win) shapes = [] shapes.append(Square(Point(50, 20), Point(100, 280))) # shapes.append(Ball(Point(350, 20), Point(400, 280))) # remove comment to test Ball # shapes.append(Triangle(Point(50, 320), Point(100, 570))) # remove comment to test Triangle # shapes.append(Octagon(Point(350, 320), Point(400, 570))) # remove comment to test Octagon for shape in shapes: shape.displayName(win) shape.displayNumSides(win) shape.drawShape(win) win.getMouse() win.close() if __name__ == '__main__': main() in python pleaseDesign an application that does the following: A Solid can be a FlatSurfaceSolid or a CurvedSurfaceSolid. Every solid will have a volume. The method volume will be polymorphic. A solid has faces, vertices and edges. A flat-surface solid also has a variable called side which represents the length of the side. A curved-surface solid also has a radius. A Cube is a FlatSurfaceSolid. A cube has 6 faces, 8 vertices and 12 edges. It will have a side. A Sphere is a CurvedSurfaceSolid. It has 1 face, 0 vertices and 0 edges. It will have a radius. Create an ArrayList of solids (driver file named YourLastNameCISC231Q1.java). The arraylist will have 4 elements – 2 cubes (one with side length 3 and another will side length 4) and 2 spheres (one with radius 3 and another with radius 4). Create a driver class to instantiate an array of solids and display the details of each solid along with the volume of each solid.// Rectanlge.cppusing namespace std;class Rectangle{ public: // Declare public methods here private: // Create length and width here}; void Rectangle::setLength(double len){ // Write setLength here}void Rectangle::setWidth(double wid){ // write setWidth here}double Rectangle::getLength(){ // write getLength here}double Rectangle::getWidth(){ // write getWidth here}double Rectangle::calculateArea(){ // write calculateArea here}double Rectangle::calculatePerimeter(){ // write calculatePerimeter here} // This program uses the programmer-defined Rectangle class. #include "Rectangle.cpp"#include <iostream>using namespace std; int main(){ // Create Rectangle objects here // Set the lengths and widths here // Print the areas and perimeters here return 0;}
- Please check the images for the whole question. Thank you. /* TestCarSensor.java - program to test the CarSensor class.*/public class TestCarSensor{public static void main (String[] args){// 1. declare CarSensor objectsCarSensor generic = new CarSensor(); // default sensor, all values "zero"CarSensor tempCel = new CarSensor("temperature sensor", -50, +300, "C"); // temperature sensor (Celsius)CarSensor speed = new CarSensor("speed sensor", 0, 200, "km/h"); // speed sensor (kms/hour)CarSensor speed2 = new CarSensor("speed sensor 2", 0, 200, "m/h"); // speed sensor 2 (miles/hour)// 2. test changing desc and limitsSystem.out.println ();System.out.println ( generic ); // display generic sensor (zero)generic.setDesc ("special sensor"); // change descriptiongeneric.setLimits (-5,5,"units"); // change limitsSystem.out.println ( generic ); // display generic sensor again// 3. test displaying object (calling .toString() )System.out.println ();System.out.println ( tempCel );System.out.println (…Shape Class JAVA Implement the Shapehierarchy shown in figure below. Shape TwoDimensionalShape ThreeDimensionalShape Circle Square Sphere Cube Each TwoDimensionalShape should contain method getArea to calculate thearea of the two-dimensional shape. • Each ThreeDimensionalShape should have methods getArea and getVolume tocalculate the surface area and volume, respectively, of the three- dimensional shape. Add OneDimensionalShape with sub classes , and add more shapes to classes (TwoDimensionalShape , ThreeDimensionalShape ). Create a program that uses an array of Shape references to objects of each concrete class in the hierarchy. The program should print a text description of the object to which each array element refers. • Also, in the loop that processes all the shapes in the array, determine OneDimensionalShape, whether each shape is a TwoDimensionalShape or a ThreeDimensionalShape. If it is a TwoDimensionalShape, it is display ThreeDimensionalShape, display its area and volume. its…public class StairViewer public static void main(String(] args) // Step 2: Create a rectangle and draw it as the // top step of the stair // location: (20, 10) // size: (20, 20) 18 // Step 3: Create a rectangle and draw it as the 19 // middle step of the stair 20 // location: below the top step, aligned on left // size: (40, 20) 21 22 23 24 // Step 4: Create a rectangle and draw it as the 25 // bottom step of the stair 26 // location: below the middle step, aligned on left // size: (60, 20) 27 28 29 30 } 31 32