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
Q: ElectionResults java
A: ElectionResults java
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: Data Structures and algorithms (C/C++) Note: Solve it using Structures Q13. Create a linked list w...
A: Algorithm: Start Create a class named node which represents a node of linked list with data, next (...
Q: Please make me a c++ program for following question. Create a class called Matrix that represents a...
A: Algorithm: Start Create a class named Matrix with a 2d integer array 'a' of size 3x3 as an attribut...
Q: Why do we utilise MATLAB to solve difficulties in Computational Geometry?
A: Given :- Why do we utilise MATLAB to solve difficulties in Computational Geometry
Q: a) Write a C+ program that inputs a three digits number from the user and display it in reverse orde...
A: Program using c ++ input value from user and display in reverse order.
Q: At any given time, how many primary partitions can be active?
A: Introduction: An operating system may be installed on a primary partition. The operating system is ...
Q: 02:Write a MIPS assembly program that computes an employee's monthly salary. The program should take...
A: Solution: Given, Write a MIPS assembly program that computes an employee's monthly salary. The pr...
Q: ase explain how you got output
A: Lets see the solution.
Q: C++ programming Question. Try to find the average speed from the velocities of ten particles(in m/s)...
A: Distance travelled over time is used to calculate speed. Distance/Time = Speed So far, the examples ...
Q: Consider a system with 13 dedicated devices of the same type and all jobs currently running on this ...
A: Values are assigned while employing carefully thought: Shaped the current involves assigning a prior...
Q: Construct an AVL tree for the following list: 5, 7, 8, 4, 2, 3, 9, by inserting their elements succe...
A: INTRODUCTION: The AVL tree is a self-balancing Binary Search Tree with a maximum height difference ...
Q: Show an example of the Authorization action to review the Field and Also write steps to create a new...
A: Approval Actions are used in the Approval Processes. Approval action is a action that is performed ...
Q: plain why you think ion should return "i
A: The python description is shown as,
Q: for(int 1 = 0; 1 < 5; i++){ for(int j = 0; j < 5; j++){ cout << (i + j) % 2; } cout << endl; }
A: Task : Given the code segment. The task is to find the output of the code.
Q: b) What is the difference between (x++), (x+-), and (--x). c) Write the purpose for the use of the f...
A: Introduction: Here we are required to mention the difference between x++ and x+= and --x in the firs...
Q: What argument values are necessary when calling Function 716Ch to read a binary array from a file th...
A: Introduction: This function reads binary data from a file and returns it as data. The format of the...
Q: From the diagram, the risk management was taken by administrator failed to response the attacker tam...
A: With either, an analogy is what appraisal: And what was the definition of such risk management? The ...
Q: What is the bare minimum in terms of processors and RAM necessary for the ATA Gateway to function pr...
A: Microsoft Advanced Threat Analytics (ATA) is an application to protect the organization against diff...
Q: What are CSV text files, and how do they work? What is a straightforward command that can be used to...
A: CSV text files: CSV text files are comma separated files. These files are simple text files in which...
Q: Give the hardware implementation along with explanation for the general register organization of CPU...
A: A bunch of flip-flops shapes a register. A register is a one of a kind fast stockpiling region in th...
Q: Physicians must follow HAPAA regulations when they send data to the cloud, and the penalties for not...
A: Introduction: An Internet service provider (ISP) organizes and administers data storage under a clou...
Q: Microsoft Excel 2016 has a slew of new and enhanced functionality. Which function do you believe is ...
A: List of new feature that are introduced in MS Excel 2016: The 'Tell Me' Box. Forecasting. Search f...
Q: 2. A singer voice is sampled for 4 second by an 8-bit ADC at a sampling frequency of 10 kHz. The sam...
A: The highest frequency range possible: Unesco Audio Mandate To promote recommended 48 kHz as with mos...
Q: What will be the problem with the following algorithm for finding an item in an unsorted array? How ...
A: We need to find the problems in the given algorithm to find the item in an unsorted array. The given...
Q: Instruction: Create a java program that generates elements (randomly from 10 - 75) of a 2-dimensiona...
A: Logic :- (I) To generate random number in range:- arr[i][j]= Min + (int)(Math.random() * ((Max - M...
Q: Which of the following provides the most accurate definition of XBRL? O A universal, worldwide stand...
A: XBRL also known as Extensible Business Reporting Language. XBRL : It is a language used for electron...
Q: Write code in java object oriented programming. You are required to create a simple command line ap...
A: Here I create a Text.java class which is a superclass. then create an Email.java class which is the ...
Q: String method(String str, String x, int y ){ lladds the x string in the str at y index }
A: import java.util.*; import java.lang.*;class Solution{ public static String method(String str, ...
Q: Nhy do we utilise MATLAB to solve difficulties in Computational Geometry?
A: Introduction: In business and academia, MATLAB is used by millions of engineers and scientists for d...
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: You are given a collection of N non-empty strings, denoted by S1, S2, .. , Sµ. Then you are given N ...
A: Here I have taken input from the user and then stored the values into the variables. Then, I have cr...
Q: Assume that a computer system is having 4-page frames for holding process pages in the main memory. ...
A: In FIFO algorithm, frame which has been occupied first will be first choosen for replacement. In op...
Q: 2a) Briefly describe corporate espionage. 2b) Differentiate between a forensic image and a logical ...
A: 2 a) Corporate Espionage: corporate espionage is the practice of stealing and unauthorized revealing...
Q: Task: 1. Write a C program to simulate the sequential file allocation in a very simple file system. ...
A: Solution:-- 1)The given question has required for the solution to be provided with the help of the...
Q: Instruction: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensiona...
A: Logic :- (I) To generate random number in range:- arr[i][j]= Min + (int)(Math.random() * ((Max - M...
Q: Suggest the most appropriate generic software process model that might be used as a basis for managi...
A: a) The Waterfall methodology is the best-suited general software process model for controlling anti...
Q: exploring, analyzing, focusing, and implementing a future is one that departs from seat-of-the-pants...
A: exploring, analyzing, focusing, and implementing a future is one that departs from seat-of-the-pants...
Q: What does a grey hat hacker accomplish exactly?
A: Grey hat hacker are different from black hat hacker and white hat hacker but not much it exists some...
Q: QI Write program in fortran to find the maximum number of (x,y,z)?
A: code is given below
Q: Write a program that reads an integer and uses a single variable to add 5 to the integer, multiply b...
A: Given :- Write a program that reads an integer and uses a single variable to add 5 to the integer, ...
Q: What is Linux Shell? What types of Shells are there in Linux?
A: The answer is given below.
Q: 3- Specify the truth table of tables of an octal - to - binary priority encoder.
A: Please check the step 2 for solution
Q: C++ programming Question. Try to find the average speed from the velocities of ten particles(in m/s)...
A: Here I have created an array of size 10. Next, I have taken input from the user and stored it into t...
Q: Privacy and data protection in mobile apps are important considerations.
A: Introduction: Privacy and data protection in mobile apps are important considerations.
Q: Given a weighted graph as follow:
A: In this question, we are given a graph and have to draw the minimum spanning tree GIVEN: In the bel...
Q: b) Find the errors and correct them: 1) int sum 0;x; do{ cin<<x; Sumt-x;] while(x!-0.0) 2) (for int ...
A: 1) variable names are case sensitive in CPP. The correct code is: int sum=0,x; do{ cin>>x; sum...
Q: onstruct a subprogram that solves the differential equation set dy = g(y,t)dt dt rith the fourth-ord...
A: SUMMARY: - Hence, we discussed all the points. of
Q: Information and Data Visualization
A: The given question is to discuss about the information and the Data visualization along with the exa...
Q: When a programme executes 500 instructions, each cycle takes 5 seconds, and the clock cycle time is ...
A: what is the CPU time?
In JAVA pls
Step by step
Solved in 2 steps with 1 images
- Given the Solid class, extend it with: Pyramid Cylinder RectangularPrism Sphere Make sure to create the constructor and override the volume and surfaceArea methods. Also extend RectangularPrism with Cube. HINT: You can look up formulas for how to compute the volume and surface area of a certain type of shape online. ========================================== public class SolidTester{public static void main(String[] args){String name;double volume;double surfaceArea; // Pyramid constructor should take name, length, width, height// in that orderPyramid pyramid = new Pyramid("My pyramid", 1, 3, 5);name = pyramid.getName();volume = round(pyramid.volume(), 2);surfaceArea = round(pyramid.surfaceArea(), 2);System.out.println("Pyramid '" + name + "' has volume: " + volume +" and surface area: " + surfaceArea + "."); // Sphere constructor should take name then radiusSphere sphere = new Sphere("My sphere", 4);name = sphere.getName();volume = round(sphere.volume(), 2);surfaceArea =…Add the following constructor to your Rectangle class: public Rectangle(Point p, int width, int height) Construct a new Rectangle whose top-left corner is specified by the given Point and with the given width and height.*Create a rectangle class using all methods given below.* *Use Java* Class Rectangle will have the following instance variables: •x –a double that represents the x coordinate of the lower left vertex of the rectangle •y –a double that represents the y coordinate of the lower left vertex of the rectangle •width –a double that represents the width of the rectangle •height–a double that represents the height of the rectangle •color –a String that represents the color of the rectangle •filled –a boolean variable that is true if the rectangle is filled, and false if it is not Rectangle constructor: The constructor should be: Rectangle (double x, double y, double height, double width, String color, boolean filled) Parameters are, in order,the x and y coordinates of the lower left corner, the height, the width, and the color of the rectangle. The constructor should check that these values represent a valid rectangle. If they do, then it should initialize the rectangle to these values.…
- Answer the prompt with given main method: Code: import java.awt.*; public class TestRandomWalker { public static final int STEPS = 500; public static void main(String[] args) { RandomWalker walker = new RandomWalker(); // instantiate Walker object DrawingPanel panel = new DrawingPanel(500, 500); Graphics g = panel.getGraphics(); // advanced features -- center and zoom in the image panel.getGraphics().translate(250, 250); panel.getGraphics().scale(4, 4); // make the walker walk, and draw its movement int prevX = walker.getX(); // initialize Walker display int prevY = walker.getY(); for (int i = 1; i <= STEPS; i++) { g.setColor(Color.BLACK); g.drawLine(prevX, prevY, walker.getX(), walker.getY()); // update Walker display walker.move();…This is for pygame Ball Class: The Ball class inherits from Drawable and it will draw a circle at its current location. You must implement at the very least the required methods of the base class (draw and get_rect), as well as a constructor. You may need to implement other methods as part of the public interface. This is the Drawable ClassWrite a class that represents a player in a game. The player should have a name, password,experience points, an inventory array of four strings, and a location x,y. Your class shouldhave mutator and accessor methods for all variables. For example: setName(), getName(). Itshould have a suitable display method. Mutators and accessors should be public but allvariables should be private. To implement get inventory, use string * getInv(); Use the scoperesolution operator to implement larger methods such as display(). Use in class methods forshorter methods such as setName(), getName(). (in C++)Example:void setName(string name){this->name = name;}string *getInv();...string* player::getInv(){return inventory;}Note that in the above method setName “this->” is required for disambiguation. If writtenvoid setName(string n){name = n;}“this->” is not required.Write a test program that creates three players and displays them.Example Output:This program generates three player objects and…
- A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it actually moves by 2 * n steps. Implement a FastCritter subclass of Critter whose move method behaves as described. What do I need to change to make it work? import java.util.ArrayList; /** A simulated critter.*/public class Critter //superclass{ private int position; private ArrayList<String> history; /** Constructs a critter at position 0 with blank history. */ public Critter() { position = 0; history = new ArrayList<String>(); } /** Gets the history of this critter. @return the history */ public ArrayList<String> getHistory() { return history; } /** Adds to the history of this critter. @param newValue the desired state */ public void addHistory(String event) { history.add(event); } /** Gets the position of this critter. @return the position */ public int getPosition() {…class Point: """ A point in a two-dimensional coordinate plane """ def __init__(self, x, y): """ Create a point with an x and y coordinate """ self.x = x self.y = y def __str__(self): """ Generate a string representation of a point """ return("(" + str(self.x) + "," + str(self.y) + ")") # Part 1 - Rectangle Classclass Rectangle: """ A rectangle in a two-dimensional coordinate plane """ def __init__(self, bottom_left_x, bottom_left_y, top_right_x, top_right_y): """ Create a rectangle defined by its bottom left and top right corner coordinates """ self.bottom_left = Point(bottom_left_x, bottom_left_y) self.top_right = Point(top_right_x, top_right_y) self.bottom_right = Point(top_right_x, bottom_left_y) self.top_left = Point(bottom_left_x, top_right_y) def __str__(self): """ Generate a string…Create the class Suitcase. Suitcase has things and a maximum weight limit, which defines the greatest total allowed weight of the things contained within the Suitcase object. Add the following methods to your class: A constructor, which is given a maximum weight limit public void addThing(Thing thing), which adds the thing in the parameter to your suitcase. The method does not return any value. public String toString(), which returns a string in the form "x things (y kg)" The things are saved into an ArrayList object: ArrayList<Thing> things = new ArrayList<Thing>(); The class Suitcase has to make sure the thing's weight does not cause the total weight to exceed the maximum weight limit. The method addThing should not add a new thing if the total weight happens to exceed the maximum weight limit. Below, you find an example of how the class can be used: public class Main { public static void main(String[] args) { Thing book = new Thing("Happiness…
- Please help me fix this java code which is supposed to be a Pac-Man game Java program is below import java.awt.*; import javax.swing.JFrame.*; public class ManyPacMans extends JFrame { public void paint(Graphics g) { g.drawghostShape(60,30,40); setBackground(Color.BLUE); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.PINK); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.RED); g.fillghostShape(130, 30,100, 80); g.drawOvalpacman(30,130,50, 60); setForeground(Color.yellow); g.fillOval(130,130,50, 60); } public Ghost(String imgPath, int x, int y, int speed, boolean ip) { super(imgPath, new int[] {0,0}, GHOST_WIDTH, GHOST_HEIGHT, GHOST_FRAMERATE, x, y); super.addFramesForAnimation("scatter", "ghost_scatter.png", 0, 0, 22,0); super.speed = speed; startX = x; startY = y; scoreValue = 200; } public ManyPacMans() { initUI(); } private void initUI() { add(new…i need help with a lego mindstorm code nxt v1 code import lejos.nxt.*;import lejos.robotics.navigation.*;/*** Robot that stops if escape button pressed.*/public class TravelTest {DifferentialPilot pilot;public void go() {pilot.travel(100, true); //100 centimeterspilot.rotate(90.0); //degreeswhile (pilot.isMoving()) {if (Button.ESCAPE.isPressed())pilot.stop();}System.out.println(" " + pilot.getMovement().getAngleTurned());System.out.println(" " + pilot.getMovement().getDistanceTraveled ());Button.waitForPress();}public static void main(String[] args) {TravelTest traveler = new TravelTest();traveler.pilot = new DifferentialPilot(3.1, 13.5, Motor.A,Motor.C); //parameters in centimeterstraveler.go(); 63}}In the above example, we cause the robot to rotate in place by a specified angleby using• void rotate(double degrees)Moreover, we must have accurate values for wheelDiameter and trackWidth forthis method to produce accurate results. The diameter is thewidest measurement from one side of…For this assignment, you are asked to create a ColorfulBouncingCircle class. ColorfulBouncingCircle should extend ColorfulCircle. Unlike the other Circle classes, it will include a velocity for the x and y axes. The constructor for ColorfulBouncingCircle includes these parameters:public ColorfulBouncingCircle(double radius, double centerX, double centerY, Color color, double xVelocity, double yVelocity) Note that we are treating x as increasing to the right and y as increasing down, as with Java’s graphics coordinates system. This was also seen with Circle’s draw method. ColorfulBouncingCircles will bounce around in a playing field which the tester will provide. The ColorfulBouncingCircle class should have a public static method to set the playing field width and height: public static void setPlayingFieldSize(double newWidth, double newHeight) ColorfulBouncingCircle will also include a method which should alter its centerX and centerY with each time tick (similar to a metronome’s…