Reference no: EM13700665
Can you answer the given questions?
Question 1: Write a Point class. A Point should have the subsequent:
- two private double fields, x and y, representing the coordinates of the Point
- a constructor that takes two double parameters with which to initialize a Point's fields
- get and set methods for the x and y coordinates
Question 2: Write a Line class. A Line should have the subsequent:
- two private Point fields, p1 and p2, representing two points of the LineSegment
- a constructor that takes two Point parameters with which to initialize a Line's fields
- get and set methods for the two points
- an intersects method that takes a Line parameter and will return a new Point object representing where the two Lines intersect.
If the two Lines are parallel, you should return null. The header will look like this: "public Point intersects (Line otherLine)".
Question 3: Write a void method that takes as a parameter an array of Lines and prints out the location of each intersection. The intersection of any two lines should only be printed once (in other words, don't print the intersection of line1 and line2, and then print the intersection of line2 and line1).
Solve these questions in details and give examples to support your rationale. Be sure to add comments. Comments should be added in the program to explain your calculations and program.
What is the ph of a buffer prepared by adding of weak acid
: Question- What is the pH of a buffer prepared by adding 0.405mol of the weak acid HA to 0.608mol of NaA in 2.00 L of solution. The dissociation constant Ka of HA is 5.66×10?7.
|
Write a program that draws a picture of a house
: Write a program that draws a picture of a house. It could be as easy as the accompanying figure, or if you like, make it more elaborate (3-D, skyscraper, marble columns in the entryway, whatever).
|
Write a class called misc that has no instance variables
: Write a static double method called evaluateQuadraticPolynomial that takes four double parametersa, b, c, and x and returns the value of ax^2 + bx + c
|
How many dissociated h+ ions are there in aqueous solution
: Question- At 25 °C, how many dissociated H+ ions are there in 341 mL of an aqueous solution whose pH is 11.47
|
Write a void method that takes as a parameter
: Write a Point class. A Point should have the subsequent - Write a void method that takes as a parameter an array of Lines and prints out the location of each intersection. The intersection of any two lines should only be printed once
|
What is the mass percent water in cobalt(ii) hexahydrate
: This is due to the fact that the hydrate is a deep magenta color while the anhydrous form is a pale blue. As the humidity level changes, the color changes as well. What is the mass percent water in cobalt(II) hexahydrate
|
Write a bag class with a generic type
: Write a Bag class with a generic type. Write a class such as item that has a name and price - Add objects of item to the bag and find the average and the total of the price of all items in the bag.
|
Find its speed after given time
: A 1.5 x 103-kg car is pulled horizontally by a tow truck. The tension in the tow rope is 2.1 x 103N, and a 1.8 x 102 N friction force opposes the motion. If the car starts from rest, what is its speed after 5.0 s
|
Explain if a buffer solution is 0.100 m in a weak acid
: Question- If a buffer solution is 0.100 M in a weak acid (Ka=3.8 x 10^-5) and 0.480 M in its conjugate base, what is the pH
|