9. Write a class to represent spheres. Your class should implement the fol- lowing methods: init (self, radius) Creates a sphere having the given radius. getRadius (self) Returns the radius of this sphere. surfaceArea (self) Returns the surface area of the sphere. volume (self) Returns the volume of the sphere. Use your new class to solve Programming Exercise 1 from Chapter 3. DII F5 F6
Q: What is an instantaneous description (ID) of a pushdown automaton (PDA)?
A: Answer the above question are as follows
Q: A projectile is launched at an angle e and speed of u. The projectile travel time t, maximum travel…
A: - We have to code for the projectile. - We will use python here.
Q: What exactly is a histogram? Create a scenario for a problem or circumstance, then create a…
A: Introduction: Here we are required to explain what is the histogram. Also, we are asked to draw a…
Q: Create a program that approximates the three roots of the equation f(x) = 5.3221 x3 - 4.2842 x.…
A: A Python program that approximates the three roots of the equation f(x) = 5.3221 x3 - 4.2842 x2 -…
Q: Computer science What methods can be used to deal with massive data sets, which can be terabytes in…
A: Introduction: What methods can be used to deal with massive data sets, which can be terabytes in…
Q: Discuss a few limitations of virtual machine migrations.
A: Discuss a few limitations of virtual machine migrations.
Q: Complete a program in a class ToyCounter that computes the cost of toys sold in a shop. Five kinds…
A: Program for create toyCounter and compute the total cost
Q: Construct parsing table for given grammar and determine whether given grammar is CLR or Not? S->AA…
A: The answer as given below steps:
Q: Please compute the difference series of the series below (-999 for not available): T1 T2 T3…
A: We need to compute the difference series of the series given.
Q: Write a python code 2) Write a function listsort which accepts a list as a parameter, and sorts it…
A: - We have to order the list in ascending form and return it. - We used bubble sort to do the work.
Q: What are the benefits of low-density networks? What explains why these benefits exist
A: Given: we Have to discuss What are the benefits of low-density networks.explains why these…
Q: Computer science Short answer What is an array such a useful tool?
A: Introduction: When several variables of the same type must be utilized, arrays are employed.
Q: he following is an old word puzzle: “Name a common word besides tremendous, stupendous, and…
A: # Python3 code for the above program class TrieNode(): def __init__(self): #…
Q: What exactly is Windows 95 Security?
A: Introduction: Windows 95 appears to be a DOS-inspired operating system.
Q: How do the tools function to assess network vulnerabilities?
A: Introduction: In order to scan your application for new and existing threats, vulnerability…
Q: open environment
A: Then open environment or open system environment is explained below:
Q: What is parametric polymorphism in a subprogram, and can you give an example with an explanation of…
A: Introduction: Parametric polymorphism is a programming language method that allows for the general…
Q: In the context of CNN based Semantic Segmentation what is Transposed (“Deconvolution”) Convolution…
A: In the context of CNN based Semantic Segmentation what is Transposed (“Deconvolution”) Convolution…
Q: Explain how the terminology for the various sorts of exceptions differs from one system to the next.
A: Introduction: There are exceptions derived from the Sytem, which is System. SystemException.
Q: The string "Hello" can be stored in the array below: char Array[5); Select one: O True O False
A: Let us see the answer below. Note: In the question programming language is not mentioned. I am…
Q: Analyze the below code and fill in the blanks to complete the code #include int main() { int…
A: Solution: C Program: #include <stdio.h> int main() { int Array1[2][3] = {{10, 20, 30},…
Q: TOPIC 3. Consider an open production model having n industries with n> 1. In order to produce $i of…
A: Solution: =>Given that we have => Consider an open production model have n industries.…
Q: What is the most effecient way to access data when you have mulitple tables? a) use the VLOOKUP…
A: What is the most efficient way to access data when you have mulitple tables?
Q: Rock, paper scissor games. Use a random function for generating the random output by the computer…
A: Solution: Given, Use a random function for generating the random output by the computer side. The…
Q: 5. Given the definitions of class x (Figure 3) and class Y (Figure 4) below, class x { private int…
A: SolutionFigure 3 In line 2, create a class instance of name x In line 3, created an attribute of…
Q: 2. Given a universal 4 bit shift register that shifts the loaded value 0101 to the left one timethe…
A: Shift Register: It is a group of flip flops which is used to store multiple bits of data. These…
Q: How to write a SQL sentence by grouping and aggregation? What is a null value? How to find…
A: write a SQL sentence by grouping and aggregation? What is a null value? How to find information with…
Q: What is the main role of an ER diagram in data modelling? How many courses each student can have?…
A: What is the main role of an ER diagram in data modeling? An entity-relationship diagram, or ER…
Q: A processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word…
A: The answer as given below:
Q: What were some of the vulnerabilities in data security and privacy that exposed the Veterans…
A: Introduction: The Department of Veterans Affairs (VA) was one of the first government organizations…
Q: Which attribute is displayed by the attrib command for a file that is backed up and unchanged? • v •…
A: The main purpose of attrib command is to remove and set the attributes of the file
Q: The terms subnet, prefix, and BGP route should be defined and compared.
A: The Answer is in given below steps
Q: Multiply 166 by 105 using unsigned 8-bit binary multiplication to form a 16-bit result. Select the…
A: Option: A . 0100010000010110 Let, A →166- 10100110 B → 105- 01101001 A*B → (10100110)*(01101001)…
Q: Describe the elements of a backup strategy. What are the differences between backup plans for mobile…
A: Introduction: Describe the elements of a backup strategy. What are the differences between backup…
Q: Enumerate the number of perfect matchings in each of the following. Prove your answers. (а) Кп,я (b)…
A: Perfect matching is a matching which matches all the vertices of the graph, that means if every…
Q: 5. Prove that the following language is decidable: L = {0i1j 0k | i,j,k > 0 ∧ i < j < k}
A: A language is called Decidable or Recursive if there is a Turing machine which accepts and halts on…
Q: Which of the following is the correct way to define an interface?
A: The correct options with explanations are below. The incorrect options are also explained that why…
Q: Computer science Why do businesses use cold e-mails? Short answer
A: Introduction: Businesses use advertising to broaden their market reach. This is achieved by…
Q: Upon the method you chose, solve one of the below problems: i Mergesort the list…
A:
Q: Discuss why it is critical for Systems Analysts to model the subject-domain of an information system…
A: Introduction: The systems analyst is in charge of defining the transforms implied by both the source…
Q: divide and conquer strategy to understand the binary search for a sorted list of n elements. Let…
A: the solution is an given below :
Q: Describe what a database management system is and what characteristics it has.
A: Introduction: A database management system (DBMS) is another name for a database management system.
Q: Explain why asynchronous I/O operation is difficult for some memory management systems, such as…
A: Introduction: With base/bound and paging, asynchronous I/O is possible.
Q: Explain how Windows 10 handles processes.
A: Introduction: PMW (Process Manager for Windows) is an application that allows users to control their…
Q: What is the most efficient way to access data when you have multiple tables? a) Use the VLOOKUP…
A: Introduction: Here we are required to find which is the most the most efficient way to access data…
Q: 9-11 shows the completed guessing game program and includes a sample run of the m. The statement on…
A: c ++ code : #include <iostream> #include <ctime> #include <iostream> using…
Q: Access Control Lists are used by firewalls (ACL). Explain what an ACL is and what typical contents…
A: Introduction: An Access Control List (ACL) is a set of rules used to filter network traffic. ACLs…
Q: What were some of the data security and privacy flaws that exposed the Veterans Administration (VA)…
A: Introduction: The Department of Veterans Affairs (VA) was one of the first government organizations…
Q: What does a Q-value represent? Select one: a. A total future reward of a state. b. A total reward…
A: Q value usually refers to the function that the algorithm computes which means the expected rewards…
Q: List two drawbacks of a computer device that use physical isolation. List two drawbacks of a…
A: Introduction: two disadvantages of a computer device that uses physical isolation are :
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Create a class with a method. The method has to decide whether a given year is a leap year or not. Note- A year is a leap year if: • It has an extra day i.e. 366 instead of 365. It occurs in every 4 year e.g. 2008, 2012 are leap years. For every 100 years a special rule applies-1900 is not a leap year but 2000 is a leap year. In those cases, we need to check whether it is divisible by 400 or not. > > ClassAssignmentEx2 ©LeapYearDecider javaclassnotes.assignments javaclassnotes.assignments ClassAssignmentEx2() LeapYearDecider() main(String):void A isLeapYear(int):booleanImplement the class Character The role should be “primary” or “secondary” all other values are not acceptable. Considercapital and small letters variance. The gender should be “m” or “M” for male or “f” or “F” for female. The age should be a positive value. The giveRaise method increase the salary of a character by a given percentage with amaximum salary of 10000. The toString method returns a string that describes the character. For example: [Elisabeth Kane, female, 35, primary,4500$] 2) Implement the class Play A Play can have at most 20 characters. The real number of characters is registered in nbOfCharacters and is updated automaticallywhen a new character is added. AddCharacter method adds a new character to the characters array and updates thenbOfCharacters value. The attribute nbPlay keeps track of the number of Plays created. The toString method returns a string description of the play including name, genre and thenames of all the characters.Example: [The Opera…Implement the above system using inheritance in the best possible way. Keep every object size as small as possible. Implement all methods (setter/getter/constructors and destructors) Note that the region area is 0 while the city is len*width and the country is the sum of their cities. Create array of countries called Arab of 22 countries. Write a function fill that fills the array Arab Write a method that finds the city that has the max area in a country Write a method that sorts the cities in a country from the largest to the smallest area Write a function that returns array of countries of the same area of Arab Write a function that compares between two countries. It returns true if country1 area greater than country2 area. Write a function to move a city from one country to another.
- Implement a toString method for the following class that returns a string containing the class name and the names and values of all instance variables.Let's get some more practice with algorithms by escaping from a maze! Implement a public class Maze Escape that provides a single public class method named escape. escape accepts a single parameter, a Maze object with methods explained below. Your goal is to manipulate the maze until you reach the exit, and then return it when you are finished. If the passed maze is null, throw an IllegalArgumentException. To navigate the maze, using the following Maze methods: • isFinished (): returns true when you have reached the exit of the maze • turnRight () rotates your character 90 degrees to the right • turnLeft() rotates your character 90 degrees to the left • canMove () returns true if you can move one cell forward, false otherwise. Your path may be blocked by a wall! • move () moves your character one cell forward and increases the step counter The passed Maze object represents a simply-connected or perfect maze: one that contains no loops. As a result, we suggest that you pursue a classic…1. Write a java class called Pokemon that has a name (e.g. “Pikachu”) and a number (e.g. 25). Implement a constructor that takes both values as parameters. Implement accessors for both values. Implement a toString() that returns a string in the format “Name(number)”, e.g. “Pikachu(25)”. Implement an equals(Object) method (two Pokémon are considered equal if they have the same number). Implement a hashCode() method that returns the number. (remember the equals and hashCode contract). 2. Create a java class, PokemonComparator, that implements Comparator and compares two Pokémon in reverse order by number. For example, if Pokemon A's number is 25 and B's number is 50, compare(A, B) would return a number > 0 because B should come first. Hint: what if you subtracted the numbers? 3. Write a new class, PokemonMain, with a main method that: a. Creates a binary tree with your favorite Pokémon at the root and a new PokemonComparator. b. Insert at least 10-15 more Pokémon in any order. c.…
- Add the following accessor methods to your Rectangle class:public boolean contains(int x, int y)public boolean contains(Point p)Returns whether the given Point or coordinates lie inside the bounds of this Rectangle .Write the source code of the class Passenger. A passenger can travel with an infant (i.e. his/her child). Code the class Infant as an inner class of the class Passenger. If a passenger is not travelling with an infant, the getInfantMonths method must return –1.In java language Write a Rectangle class. A Rectangle has properties of width and length. You construct a Rectangle object by providing the width and length in that order. If no width and length are provided to the constructor, construct a Rectangle with width 0.0 and length 0.0. We want to be able to get and set both the width and the length independently. We also want to be able to ask for the area of the rectangle and the perimeter of the rectangle. What will the object need to remember? width and length - those are the instance variables. Rectangle class has these constructors : public Rectangle() - Constructs a new rectangle with width and length of 0.0. public Rectangle(double width, double length) - Constructs a new rectangle with the given width and length. Remember that the job of the constructor is to initialize the instance variables. It has these methods. public double getWidth() - Gets the width of this Rectangle public double getLength() - Gets the length of this…
- Write a Rectangle class. A Rectangle has properties of width and length. You construct a Rectangle object by providing the width and length in that order. If no width and length are provided to the constructor, construct a Rectangle with width 0.0 and length 0.0. We want to be able to get and set both the width and the length independently. We also want to be able to ask for the area of the rectangle and the perimeter of the rectangle. What will the object need to remember? width and length - those are the instance variables. Rectangle class has these constructors : public Rectangle() - Constructs a new rectangle with width and length of 0.0. public Rectangle(double width, double length) - Constructs a new rectangle with the given width and length. Remember that the job of the constructor is to initialize the instance variables. It has these methods. public double getWidth() - Gets the width of this Rectangle public double getLength() - Gets the length of this Rectangle public void…In java language Write a Rectangle class. A Rectangle has properties of width and length. You construct a Rectangle object by providing the width and length in that order. If no width and length are provided to the constructor, construct a Rectangle with width 0.0 and length 0.0. We want to be able to get and set both the width and the length independently. We also want to be able to ask for the area of the rectangle and the perimeter of the rectangle. What will the object need to remember? width and length - those are the instance variables. Rectangle class has these constructors : public Rectangle() - Constructs a new rectangle with width and length of 0.0. public Rectangle(double width, double length) - Constructs a new rectangle with the given width and length. Remember that the job of the constructor is to initialize the instance variables. It has these methods. public double getWidth() - Gets the width of this Rectangle public double getLength() - Gets the length of this…JAVA HELP PLEASE! Write a class Rectangle that has only the following public methods (you can add other non-public methods if you think you need them): Write a constructor that creates a rectangle using the x, y coordinates of its lower left corner, its width and its height (the parameters must be in that order). Creating a rectangle with non-positive width or height should not be allowed; throw an IllegalArgumentException for those cases. The values of x and y are allowed to be negative. Write a method overlap(Rectangle other). This method should return true if this rectangle overlaps with other, false otherwise. Rectangles that touch each other are not considered to be overlapping. Write a method toString that returns a String. The string should be formatted exactly as:“x:2, y:3, w:4, h:5”without the quotation marks and replacing the numbers with the actual attribute values of the object. A class called Rectangle exists in Java already. You are not allowed to use this class in any…