4. Define the Circle2D class that contains: > Two double data fields named x and y that specify the center of the circle with get methods. A data field radius with a get method. > A data field radius with a get method. > A no-arg constructor that creates a default circle with (0, 0) for (x, y) and 1 for radius. > A constructor that creates a circle with the specified x, y, and radius. > A method getArea() that returns the area of the circle. > A method getPerimeter() that returns the perimeter of the circle. > A method contains(double x, double y) that returns true if the specified point (x,y) is inside this circle(a) > A method contains (Circle2D circle) that returns true if the specified circle is inside this circle(b) > A method overlaps(Circle2D circle) that returns true if the specified circle overlaps with this circle(c)
Q: What is the output of the program? #include #include using namespace std; int checking (int x = 7,...
A: d. compile time error. because, checking function is defined in the wrong way. it should be int chec...
Q: Exercise 6: Construct a dfa that accepts the language generated by the grammar: S> abA A> baB B> aAj...
A: I'm providing both answers to the above query. I hope this will be helpful for you.
Q: Why Is Modeling Necessary
A: Communication that is both efficient and effective: Visual model diagrams may be more intelligible a...
Q: Question 40 Given the ff. code snippet, determine the time complexity: int f3(int n) { int sum = for...
A: Hello student Hope you are learning well.
Q: Using pointer arithmetic, update nthCharPtr to point to the 4th character in oddOrEven.
A: Arithmetic operation on pointers is like normal arithmetic operations only but the difference is tha...
Q: Draw an order-of-4 B-tree that results from inserting 77, 22, 9, 68, 16, 34, 13, 8 in that order int...
A: In this question, we are asked to draw a 4 order B tree Given : 4 order It means keys will be 3
Q: What is cloud computing, and what are the three types of cloud services in cloud computing?
A: Introduction: Cloud computing is the use of internet technology to deliver/enable scalable, extendab...
Q: d) it is on a computer using two's complement representation? e) it is on a computer using excess-12...
A: In two complement if msb is 1, then it is negative number, convert it into 1s complement then add 1 ...
Q: ven F: Z to Z and G:Z to Z by the rules F(n) = 2n and G(n) = [n/2] for every integer n. Is Go F =Fo ...
A: 1)B Because the values are already given for Fand G. So while executing it update the value of ...
Q: Explain What Is Difference Between Baseband And Broadband Transmission?
A: Baseband and Broadband are both networking techniques. Both have their own specific advantages as ...
Q: Consider a logical address space of 1024 pages with 2 KB page size, mapped onto a physical memory of...
A: The above question can be solved using formula: Size of physical ...
Q: Separate a file processing system from a database management system.
A: Introduction: A database management system, sometimes known as a DBMS, is a computerized data-keepin...
Q: .
A: In older times the data was stored manually on the computer files or it was stored on handwritten fi...
Q: 3.27 LAB: Mах of 3 Write a program that takes in three integers and outputs the largest value. Ex: I...
A: Given: To write code in C.
Q: 2. In Python programming language, write a program to input a string and then add the string "progra...
A: In Python programming language, write a program to input a string and then add the string "programmi...
Q: In Ruby programming language, write a program to input the radius of a sphere(in cm) and print the v...
A: Ruby is the main dynamic programming language as the focus that can be the open source which will us...
Q: What is the importance of design in SDLC (Subject: Software Design and ARchitecture)
A: Software development life cycle contain seven steps Planning Analysis Design development testin...
Q: (a) Solve u'(t) + u(t) = e' subject to u(1) = 3. (b) Find the family of functions that satisfies P"(...
A:
Q: B- Answer the following questions? 1. Multiply (10010), (11110), using binary multiplication method?...
A: Binary numbers are those numbers that are converted from decimal to binary by dividing by 2 and taki...
Q: 1- For an 8-bit word sized 64K byte memory. The number of address lines required is the number of da...
A: ROM stand for is read only memory.
Q: What is the default subnet mask for the IP address 154.13.44.87? a. 255.255.255.255 b. 255.255.255.0...
A: The current scenario here is to find the default subnet mask for the IP address 154.13.44.87 IP addr...
Q: Given the problem of searching two arrays Input: arrays A and B of n integers each, and an integer t...
A: Given : for i<-1 to n do if A[i]==t then return TRUE end ifend for for i<-1 to n do if B[i...
Q: Write the prototype function for Program A. a. c. Complete this section by writing appropriate progr...
A: Here the given program calculates the total cost of binding a given number of thesis copies. The cos...
Q: Discuss the revocation problem with respect to access control lists and capabilities. How might one ...
A: Answer: I have given answered in the brief explanation
Q: What are the advantages and disadvantages of using single address instructions?
A: What are the advantages and disadvantages of using single address instructions?
Q: Fix the problem with this piece of code: public class SomethingIsWrong { public static void main(Str...
A: The code never creates a Rectangle object. With this simple program, the compiler generates an error...
Q: n this question, we will ask whether an information cascade can occur if each individual sees only t...
A: SUMMARY: - Hence, we discussed all the points.
Q: So, when a cell in Microsoft Excel is filled with hashtags, what does it mean?
A: The hashtag filled into the cells of Excel sheets seems to be like some error, but it is not the cas...
Q: I'm wondering what the distinctions are between commercial and personal cloud service providers. Exa...
A: Introduction: Data storage management and security are critical goals for cloud service providers to...
Q: 6- Which of the following is False? A) Dynamic memory stores binary information in internal la tches...
A: We have given few statement regarding Static Memory and dynamic memory , we have asked to find which...
Q: Q4/ A- Find the complement of F=WX +YZ, then show that F.F=o and F+F=1 B- Obtain the 1s and 2s compl...
A: B. 1's and 2's complement of the binary number: One's complement: One's complement of a binary numbe...
Q: Write a C++ program to find the sum of first and last digit of a user entered number.
A: In this question, we are asked to print the sum of last and first digit of a number entered by user ...
Q: Write an algorithm to identify keyframes from a video with the file names being the timestamp as per...
A: Algorithms Leaving at least: They have to look. In comparison to that same R-CNN computational study...
Q: Write a simple parroting program that echos what the user types until they enter the word "hush". St...
A: I have included comment telling what each line of code does. Hope it helps.
Q: 1. Giving the following Java program representing the class student, complete the missing code. a. G...
A: Here, I have to write a java program for the given class Student and complete the parts given.
Q: What's the difference between event bubbling and capturing an event?
A: Event capturing and event bubbling are concepts of JavaScript. These are two ways of event propagati...
Q: sses and services had to switch to primarily online operations. This rapid shift opened organization...
A: given - operations. As travel ceased, most businesses and services had to switch to primarily online...
Q: Comparison between (Windows Linux Android Mac OS) ؟
A: Given Comparison between (Windows Linux Android Mac OS) ؟
Q: What is the running time of the QuickSort algorithm, with the naive implementation of choosing a piv...
A: Given conditions: 1. First element is pivot 2. Input array is sorted In quicksort, worst case occurs...
Q: Create a C++ function that takes two integers p and q as the parameters and then returns true in the...
A: Taking two integers p and q as the parameters and then returns true in only case of the conditions a...
Q: A surveillance system is in charge of detecting intruders to a facility. There are two hypotheses to...
A: According to the information given:- We have to find out the alarm system will send message or not o...
Q: . x,y are non-negative integers with x O y = 0. Disprove (with a counterexample) or prove (by induct...
A: Truth table for x xor y:x xor y0 0 = 00 1 = 11 0 = 11 1 = 0 Consider x = y, then if x = 1, y = 1, ...
Q: 1. This type of topology is highly reliable. A failure to one or a few nodes does not usually cause ...
A: Correct Option Mesh topology Explanation:- Mesh topology is highly reliable as in this topology thei...
Q: inversion in an array is a pair of elements that are "out of order," meaning th hat is the largest-p...
A: Lets see the solution.
Q: JAVA LAB PROGRAMMING Write a Java program to find and display all substrings of a user entered strin...
A: Code: import java.util.Scanner; public class Main{ public static void main(String args[]) { ...
Q: ions. Different Types of Programming Language Computer Number System Difference between x86 and x64...
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: What tool or technique do you think is most effective at finding vulnerabilities? Why?
A: The answer is
Q: Create employee Intrest survey form like below model
A: The Answer is in Below Steps
Q: What is the output of the following cod print(10**2//-3) а) -20 b) 33 с) -33 d) -34
A: Given The answer is given below.
Q: Let quotes = [ 'It is a truth universally acknowledged, that a single man in posse 'I hate to hear y...
A: Required HTML and JavaScript file codes are provided below with comments in code. Text format of cod...
please use java to answer the following question and please explain if we need to use boolean function to answer this question
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
- Define the Circle2D class that contains: Two double data fields named x and y that specify the center of the circle with get A data field radius with a get A no-arg constructor that creates a default circle with (0, 0) for (x, y) and 1 for radius. A constructor that creates a circle with the specified x, y, and radius. A method getArea() that returns the area of the circle. A method getPerimeter() that returns the perimeter of the circle. A method contains(double x, double y) that returns true if the specified point (x, y) is inside this circle. See Figure 10.14(a). A method contains(Circle2D circle) that returns true if the specified circle is inside this circle. See Figure 10.14(b). A method overlaps(Circle2D circle) that returns true if the specified circle overlaps with this circle. See the figure below. (a) (b) (c) Figure 10.14 (a) A point is inside the circle. (b) A circle is inside another circle. (c) A circle overlaps another circle. Draw…package assignment; public class Circle2D2 { //data fields specifying the center of the circle private double x, y; //data field radius private double radius; //default circle with (0, 0) for (x, y) and 1 for radius Circle2D2() { this(0, 0, 1); } //circle with the specified x, y, and radius Circle2D2(double x, double y, double radius) { this.x = x; this.y = y; this.radius = radius; } //return x public double getX() { return x; } //return y public double getY() { return y; } //return radius public double getRadius() { return radius; } //return the area of the circle public double getArea() { return Math.PI * Math.pow(radius, 2); } //return the perimeter of the circle public double getPerimeter() { return 2 * Math.PI * radius; } //return true if the specified point (x, y) is inside this circle public boolean contains(double x, double y) { return Math.sqrt(Math.pow(x - this.x, 2) + Math.pow(y - this.y, 2)) < radius; } //return true if…Rectangle Object Monitoring Create a Rectangle class that can compute the total area of all the created rectangle objects using static fields (variables). Remember that a Rectangle has two attributes: Length and Width. Implement the class by creating a computer program that will ask the user about three rectangle dimensions. The program should be able to display the total area of the three rectangle objects. For this exercise, you are required to apply all OOP concepts that you learned in class. Sample output: Enter Length R1: 1 Enter Width R1: 1 Enter Length R2: 2 Enter Width R2: 2 Enter Length R3: 3 Enter Width R3: 3 The total area of the rectangles is 14.00 Note: All characters in boldface are user inputs.
- 1. Part 1: A point in the x-y plane is represented by its x-coordinate and y-coordinate. Design the class Point that can store and process a point in the x-y plane. Your class should contains the following methods. Default constructor without parameters that initializes the private data member to the suitable values Constructor with parameters sets the values of the instance variables to the values of the parameter. Accessor methods that return the values of the x-axis and y-axis. setPoint method which set the values of x-axis and y-axis makeCopy method that make a copy of a received object of type Point. getCopy method that returns a copy of the current object toString method that returns the object string isEqual that returns true if the current object is equal to the received object of type point distance, which receives two objects of type Point and returns the distanceCreate 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 heightI need a step by step explanation on how to create this project. Project: Flight Time Problem Description: Design two classes: Flight and Itinerary. The Flight class stores the information about a flight with the following members: A data field named flightNo of the String type with getter function. A data field named departureTime of the GregorianCalendar type with getter and setter functions. A data field named arrivalTime of the GregorianCalendar type with getter and setter functions. A constructor that creates a Flight with the specified number, departureTime, and arrivalTime. A function named getFlightTime() that returns the flight time in minutes. The Itinerary class stores the information about the itinerary with the following members: A data field named flights of the List<Flight> type. The list contains the flights for the itinerary in increasing order of departureTime. A constructor that creates an Itinerary with the specified fights. A function named…
- Design a class named StopWatch. The class contains:■■ Private data fields startTime and endTime with getter methods.■■ A no-arg constructor that initializes startTime with the current time.■■ A method named start() that resets the startTime to the current time.■■ A method named stop() that sets the endTime to the current time.■■ A method named getElapsedTime() that returns the elapsed time for thestopwatch in milliseconds.Draw the UML diagram for the class then implement the class. Write a test programthat measures the execution time of sorting 100,000 numbers using selection sort.Design a class named MyPoint to represent a point withx- and y-coordinates. The class contains:■■ The data fields x and y that represent the coordinates with getter methods.■■ A no-arg constructor that creates a point (0, 0).■■ A constructor that constructs a point with specified coordinates.■■ A method named distance that returns the distance from this point to aspecified point of the MyPoint type.■■ A method named distance that returns the distance from this point toanother point with specified x- and y-coordinates.■■ A static method named distance that returns the distance from two MyPointobjects.Draw the UML diagram for the class then implement the class. Write a testprogram that creates the two points (0, 0) and (10, 30.5) and displays the distancebetween them.Temp Class - Create Temp class whos job is to hold a temp in degrees F and gives methods to get the temp in F, Celsius, and Kelvin. The class should follow the instance variable (field): ftemp (double type that holds F temp)Follow these methods with the class.. Constructor --Will accept Fahrenheit temperature as a double to store it in the ftemp field. setFahrenheit - The setFahrenheit method accepts a Ftemperature as a doubleto stores it in the ftemp field. getFahrenheit - Returns the value of the ftemp field, as a Fahrenheit temperature (no conversion required). getCelsius - Returns the value of the ftemp field converted to Celsius. [C e l s i u s = ( 5.0 / 9.0 ) × ( F a h r e n h e i t − 32 )] getKelvin - Returns the value of the ftemp field converted to Kelvin. [K e l v i n = ( ( 5.0 / 9.0 ) × ( F a h r e n h e i t − 32 ) ) + 273] Exemplify the temp class by writing a (test) program that is separate and promotes users for an F Fahrenheit temp. The program must create an…
- Design a class named MyInteger. The class contains: ■ An int data field named value that stores the int value represented by this object. ■ A constructor that creates a MyInteger object for the specified int value. ■ A get method that returns the int value. ■ The methods isEven(), isOdd(), and isPrime() that return true if the value in this object is even, odd, or prime, respectively. ■ The static methods isEven(int), isOdd(int), and isPrime(int) that return true if the specified value is even, odd, or prime, respectively. ■ The static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively. ■ The methods equals(int) and equals(MyInteger) that return true if the value in this object is equal to the specified value. ■ A static method parseInt(char[]) that converts an array of numeric characters to an int value. ■ A static method parseInt(String) that converts a string into an int value. Draw the UML…a. Write a FractionDemo program that instantiates several Fraction objects and demonstrates that their methods work correctly. Create a Fraction class with fields that hold a whole number, a numerator, and a denominator. In addition: Create properties for each field. The set access or for the denominator should not allow a 0 value; the value defaults to 1. Add three constructors. One takes three parameters for a whole number, numerator, and denominator. Another accepts two parameters for the numerator and denominator; when this constructor is used, the whole number value is 0. The last constructor is parameterless; it sets the whole number and numerator to 0 and the denominator to 1. (After construction, Fractions do not have to be reduced to proper form. For example, even though 3/9 could be reduced to 1/3, your constructors do not have to perform this task.) Add a Reduce() method that reduces a Fraction if it is in improper form. For example, 2/4 should be reduced to 1/2. Add an operator+() method that adds two Fractions. To add two fractions, first eliminate any whole number part of the value. For example, 2 1/4 becomes 9/4 and 1 3/5 becomes 8/5. Find a common denominator and convert the fractions to it. For example, when adding 9/4 and 8/5, you can convert them to 45/20 and 32/20. Then you can add the numerators, giving 77/20. Finally, call the Reduce() method to reduce the result, restoring any whole number value so the fractional part of the number is less than 1. For example, 77/20 becomes 3 17/20. Include a function that returns a string that contains a Fraction in the usual display format—the whole number, a space, the numerator, a slash (D, and a denominator. When the whole number is 0, just the Fraction part of the value should be displayed (for example, 1/2 instead of 0 1/2). If the numerator is 0, just the whole number should be displayed (for example, 2 instead of 2 0/3). b. Add an operator*() method to the Fraction class created in Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2. c. Write a program named FractionDem03 that includes an array of four Fractions. Prompt the user for values for each. Display every possible combination of addition results and every possible combination of multiplication results for each Fraction pair (that is, each type will have 16 results).Construct a Time class containing integer data members seconds, minutes, and hours. Have the class contain two constructors: The first should be a default constructor having the prototype Time(int, int, int), which uses default values of 0 for each data member. The second constructor should accept a long integer representing a total number of seconds and disassemble the long integer into hours, minutes, and seconds. The final member method should display the class data members.