Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134700144
Author: Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 9.6, Problem 9.6.2CP
Explanation of Solution
Creating an object for “Point2D”:
To create an object for “Point2D”, use its constructor “Point2D(x,y)” for the points of “x” and “y”.
Obtaining distance between two points:
Let take two objects for “Point2D” are “p1” and “p2”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Build a polyhedron that looks roughly like the Washington monument. Some key dimensions of the Washington Monument:
o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet.
This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements.
Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base.
The origin of the monument should be at the center of the base, directly below the peak.
Each side should be a different color, so that all the edges are plainly visible.
o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB)
o Use RGB color at least…
Build a polyhedron that looks roughly like the Washington monument. Some key dimensions of the Washington Monument:
o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet.
This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements.
Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base.
The origin of the monument should be at the center of the base, directly below the peak.
Each side should be a different color, so that all the edges are plainly visible.
o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB)
o Use RGB color at least twice, to…
Build a polyhedron that looks roughly like the Washington monument. Some key dimensions of the Washington Monument:
o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet.
This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements.
Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base.
The origin of the monument should be at the center of the base, directly below the peak.
Each side should be a different color, so that all the edges are plainly visible.
o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB)
o Use RGB color at least…
Chapter 9 Solutions
Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
Ch. 9.3 - Prob. 9.3.1CPCh. 9.3 - How do you define a class?Ch. 9.3 - How do you declare an objects reference variable?Ch. 9.3 - How do you create an object?Ch. 9.4 - Prob. 9.4.5CPCh. 9.4 - When will a class have a default constructor?Ch. 9.5 - Which operator is used to access a data field or...Ch. 9.5 - What is an anonymous object?Ch. 9.5 - Prob. 9.5.3CPCh. 9.5 - Is an array an object or a primitive-type value?...
Ch. 9.5 - Prob. 9.5.5CPCh. 9.5 - What is wrong in the following code? 1. class Test...Ch. 9.5 - Prob. 9.5.7CPCh. 9.6 - Prob. 9.6.1CPCh. 9.6 - Prob. 9.6.2CPCh. 9.6 - Which packages contain the classes Date, Random,...Ch. 9.7 - Suppose the class F is defined in (a). Let f be an...Ch. 9.7 - Prob. 9.7.2CPCh. 9.7 - Can you invoke an instance method or reference an...Ch. 9.9 - Prob. 9.9.1CPCh. 9.9 - Prob. 9.9.2CPCh. 9.9 - In the following code, radius is private in the...Ch. 9.10 - Prob. 9.10.1CPCh. 9.10 - Show the output of the following program: public...Ch. 9.10 - Show the output of the following code:Ch. 9.10 - Prob. 9.10.4CPCh. 9.11 - What is wrong in the following code? 1public class...Ch. 9.12 - If a class contains only private data fields and...Ch. 9.12 - If all the data fields in a class are private and...Ch. 9.12 - Is the following class immutable? public class A {...Ch. 9.13 - What is the output of the following program?...Ch. 9.14 - Prob. 9.14.2CPCh. 9.14 - Prob. 9.14.3CPCh. 9 - (The Rectangle class) Following the example of the...Ch. 9 - (The Stock class) Following the example of the...Ch. 9 - (Use the Date class) Write a program that creates...Ch. 9 - Prob. 9.4PECh. 9 - (Use the GregorianCa1endar class) Java API has the...Ch. 9 - (Stopwatch) Design a class named StopWatch. The...Ch. 9 - (The Account class) Design a class named Account...Ch. 9 - (The Fan class) Design a class named Fan to...Ch. 9 - (Geometry: n-sided regular polygon) In an n-sided...Ch. 9 - Prob. 9.10PECh. 9 - (Algebra: 2 2linear equations) Design a class...Ch. 9 - (Geometry: intersecting point) Suppose two line...Ch. 9 - (The Location class) Design a class named Location...
Knowledge Booster
Similar questions
- Build a polyhedron that looks roughly like the Washington monument. Some key dimensions of the Washington Monument: o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet. This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements. Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base. The origin of the monument should be at the center of the base, directly below the peak. Each side should be a different color, so that all the edges are plainly visible. o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB) o Use RGB color at least…arrow_forwardBuild a polyhedron that looks roughly like the Washington monument. Some key dimensions of the Washington Monument: o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet. This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements. Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base. The origin of the monument should be at the center of the base, directly below the peak. Each side should be a different color, so that all the edges are plainly visible. o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB) o Use RGB color at least…arrow_forwardYou have n widgets, each of which is of a certain type. You want to determine whether there is a majority type; i.e., if there is a type t such that the number of widgets of type t is greater than n/2. For instance, the set of 7 widgets with types A, A, B,C, A, C, A, respectively has a majority type A since there are 4 widgets of that type. On the other hand, the set of 6 widgets with types A, A, B, C, D, A has no majority type. Unfortunately, you are unable to determine the type of any given widget. Instead, the only operation available to you is to call a subroutine Equality Test that takes two widgets as input and returns True if both are of the same type and False otherwise. Give a divide-and-conquer algorithm for determining if there is a majority type in a given set of n widgets. The running time of your algorithm is the number of calls made by your algorithm to Equality Test. Analyze the running time of your algorithm. Ideally, the running time of your algorithm should be…arrow_forward
- Implement the following by extending the Cubes project. For all shapes, there should be no colocated vertices. For the meshes, you may use arbitrary indexed convex-polygon faces that G3D will automatically tessellate into triangles on load. This project's report requires you to plan your approach before you begin writing code, so read the whole document before beginning implementation. Create data-files/model/cube.off, an axis-aligned cube with unit edge lengths, centered at the origin. You may make this file in a text editor directly, or write a procedure to generate it. Create a procedure (function or method) named makeCylinderthat generates a file data-files/model/cylinder.off given a radius and height. This file should be an indexed convex-polygon mesh for a cylinder about the yy-axis that is centered at the origin. Create a user interface for invoking makeCylinder. Use number boxes for the parameters and a button labelled “Generate” to actually launch the execution. Display a…arrow_forwardAdd a constructor to the Point class that accepts another Point as a parameter and initializes this new Point to have the same (x, y) values. Use the keyword this in your solution.arrow_forwardTHIS IS MY FOLLOW UP QUESTION, I WANT TO MORE ABOUT THIS. Object: SquareStates: sideBehaviors: computeArea(), computePerimeter() Object: RightTriangleStates: base, heightBehaviors: computeArea(), computePerimeter() - Find first the hypotenuse which is the 3rd (longest) side using the Pythagorean formula. You may use the sqrt() method defined in Math Java classarrow_forward
- This just colored the point I want coloring the line also pleasearrow_forward(Count entire words, not parts of words. For example rate and rated would be different counts. Say rate is there 10 times and rated is there 5 times, that should be the count not rate 15, rated 5. Don't count parts of words.) A Map is an interface that maps keys to values. The keys are unique and thus, no duplicate keys are allowed. A map can provide three views, which allow the contents of the map to be viewed as a set of keys, collection of values, or set of key-value mappings. In addition, the order of the map is defined as the order in which, the elements of a map are returned during iteration. The Map interface is implemented by different Java classes, including HashMap, HashTable, and TreeMap. Each class provides different functionality and can be either synchronized or not. Also, some implementations prohibit null keys and values, and some have restrictions on the types of their keys. A map has the form Map <k,v> where: K: specifies the type of keys maintained in…arrow_forwardBuild a polyhedron that looks roughly the washington monument . Some key dimensions of the Washington Monument: o The width of the base is about 55 feet.o The width of each side at the top is about 34 feet.o The height of the small pyramid (pyramidion) at the top of the monument is 55 feet. o The height of the whole monument is 555 feet. This should help you get something that looks approximately like the Washington monument. Exactness is not necessary, and indeed, you should make your code appropriately parameterized.Some additional requirements. Your polyhedron will have 8 sides (four for the pyramidion and four for the tower). You should not have a base. The origin of the monument should be at the center of the base, directly below the peak. Each side should be a different color, so that all the edges are plainly visible. o Use a variety of different ways of specifying the colors (e.g. THREE.ColorKeywords, hexidecimal notation, CSS string, RGB) o Use RGB color at least twice, to…arrow_forward
- Write a program that draws a fixed polygonwith points at (30, 10), (60, 30), (50, 70), (35, 35), and (10, 50). Wheneverthe mouse is moved, display a message indicating whether the mousepoint is inside the polygon at the mouse point or outside of it, as shown inFigure. To detect whether a point is inside a polygon, use the containsmethod defined in the Node class.arrow_forwardIn this project, you are going to introduce a Netflix-like (or Amazon prime video/Hulu/Apple+/Disney+) menu, composed by categories, each of which consists of a list of movies. Namely, there are a number of rows. For each row, users can browse movies in a circular way. For all rows/categories, users could browse up and down but not in a circular way. With the above background, please implement a Netflix-like menu using (1) DLL for connecting the beginning of all rows/categories; (2) each row/category is constructed by a CLL. A possible illustration of the above concepts is shown at the end of the file. Note that there is more than one way to implement the relationship between DLL and CLLS here (and the header of a CLL is not shown here because of a variety of possible implementations. You are required to introduce a header for each CLL). For the entire Netflix, here are the features included: a. Add a new category by name (e.g., void addCategory(string name)) b. Search a category by…arrow_forwardAn archery target consists of a central circle of yellow surrounded by con-centric rings of red, blue, black and white. Each ring has the same width, which is the same as the radius of the yellow circle. Write a programthat draws such a target. Hint: Objects drawn later will appear on top ofobjects drawn earlier.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education