Discover
Questions library
Collections library
Find online teacher
login
Discover
questions library
Find online teacher
login
Introduction to Java Programming, Comprehensive Version (10th Edition)
by
Y. Danial liang
Edition:
10th edition
ISBN13:
978-0133761313
ISBN10:
0133761312
772
Java programming
Home
Books
Introduction to Java Programming, Comprehensive Version (10th Edition)
Similar Books
No books found
Title
Chapter: 3 /
Q: 25
(Geometry: intersecting point) Two points on line 1 are given as (x1, y1) and (x2, y2) and on line 2 as (x3, y3) and (x4, y4), as shown in Figure 3.8a–b. The intersecting point of the two lines can be found by solving the following linear equation:
Chapter: 3 /
Q: 26
(Use the &&, || and ^ operators) Write a program that prompts the user to enter an integer and determines whether it is divisible by 5 and 6, whether it is divisible by 5 or 6, and whether it is divisible by 5 or 6, but not both. Here is a sample run of this program:
Chapter: 3 /
Q: 27
(Geometry: points in triangle?) Suppose a right triangle is placed in a plane as shown below. The right-angle point is placed at (0, 0), and the other two points are placed at (200, 0), and (0, 100)
Chapter: 3 /
Q: 28
(Geometry: two rectangles) Write a program that prompts the user to enter the center x-, y-coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the first, as shown in Figure 3.9. Test your program to cover all cases
Chapter: 3 /
Q: 29
(Geometry: two circles) Write a program that prompts the user to enter the center coordinates and radii of two circles and determines whether the second circle is inside the first or overlaps with the first, as shown in Figure 3.10
Chapter: 3 /
Q: 30
(Current time) Revise Programming Exercise 2.8 to display the hour using a 12-hour clock. Here is a sample run:
Chapter: 3 /
Q: 31
Financials: currency exchange) Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Chinese RMB
Chapter: 3 /
Q: 32
(Geometry: point position) Given a directed line from point p0(x0, y0) to p1(x1, y1), you can use the following condition to decide whether a point p2(x2, y2) is on the left of the line, on the right, or on the same line (see Figure 3.11):
Chapter: 3 /
Q: 33
(Financial: compare costs) Suppose you shop for rice in two different packages. You would like to write a program to compare the cost. The program prompts the user to enter the weight and price of the each package and displays the one with the better price. Here is a sample run:
Chapter: 3 /
Q: 34
(Geometry: point on line segment) Programming Exercise 3.32 shows how to test whether a point is on an unbounded line. Revise Programming Exercise 3.32 to test whether a point is on a line segment
total questions:
772
Previous
5
6
7
8
9
Next
Questions
772
Views
Best Answers
299
Points
5
×
Close
add reason
reason