Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and
Question:
Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between them. The formula for computing the distance is √(x2 - x1)2 + (y2 - y1)2. Note that you can use Math.pow(a, 0.5) to compute 2a. Here is a sample run:
Enter x1 and y1: 1.5 -3.4
Enter x2 and y2: 4 5
The distance between the two points is 8.764131445842194
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (9 reviews)
Output Enter x1 and y1 15 34 Enter x2 and y2 4 5 The distance of the points i...View the full answer
Answered By
Nazrin Ziad
I am a post graduate in Zoology with specialization in Entomology.I also have a Bachelor degree in Education.I posess more than 10 years of teaching as well as tutoring experience.I have done a project on histopathological analysis on alcohol treated liver of Albino Mice.
I can deal with every field under Biology from basic to advanced level.I can also guide you for your project works related to biological subjects other than tutoring.You can also seek my help for cracking competitive exams with biology as one of the subjects.
3.30+
2+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
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...
-
Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing...
-
Write a program that prompts the user to enter the center coordinates, width, and height of two rectangles from the command line.The program displays the rectangles and a text indicating whether the...
-
Problem 3: Dorado and Maya are the children of Jess and Sabel. In November 2000 Sabel died intestate leaving P2,000,000 estate before P1,000,000 deductions and P15,000 estate tax. How would the...
-
With an initial deposit of $100, the balance in a bank account after t years is f (t) = 100(1.08)t dollars. (a) What are the units of the rate of change of f (t)? (b) Find the average rate of change...
-
Find the perimeter (circumference) and area of each. 6.3 m 5 m
-
Acne Medication and Gastrointestinal Injury Since 1999, Kamie Kendall had experienced ongoing abdominal pain, and she was eventually diagnosed with ulcerative colitis and irritable bowel syndrome...
-
The management of Tinker Inc. asks your help in determining the comparative effects of the FIFO and LIFO inventory cost flow methods. For 2014, the accounting records show these data. Inventory,...
-
It took 6 seconds for the sound of a whistle to reach an observer 5400 feet away from the whistle. At what rate did the sound travel in feet per minute?
-
Accounting Today identified the top accounting firms in 10 geographic regions across the United States. Even though all 10 regions reported growth in 2011, the Southeast and Gulf Coast regions...
-
Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program that prompts the...
-
Write a program that prompts the user to enter the side of a hexagon and displays its area. The formula for computing the area of a hexagon is where s is the length of a side. Here is a sample run:...
-
Refer to Data Set 18 in Appendix B and find the sample proportion of M&Ms that are green. Use that result to construct a 95% confidence interval estimate of the population percentage of M&Ms that are...
-
Explain briefly taxable profit and also the split rate system? Define and explain the corporate income tax? Who are the shareholders? CR is resident in Country X. CR makes a taxable profit of...
-
Svetlana won $1,600,000 in a contest, to be paid in twenty $80,000 payments at yearly intervals, the first payment paid at the time of the contest. (Of course, the present value of her winnings is...
-
On December 31, the branch account on the home office books of the Camry Co. shows a balance of P8,400 and the home office account on the branch books shows a balance of P9,735. The following data...
-
Upland Orchard has acquired 70 acres of land and is deciding on what to plant. Upland currently operates a 100-acre apple orchard and may use this additional 70-acre plot for apple, but they are also...
-
The United Nations Human Development Index (HDI) uses information about a countrys life expectancy at birth (health), expected years of schooling and mean years of schooling (education), and Gross...
-
Molloy Ltd. reported the following for the fiscal year 2014: Additional information: 1. Accounts receivable decreased by $15,000 during the year. 2. Inventory increased by $7,000 during the year. 3....
-
Solve for the equilibria of the following discrete-time dynamical systems Pr pt+1 = Pr+2.0(I-Pr)
-
Write a program that prompts the user to enter a three-digit integer and determines whether it is a palindrome integer. An integer is palindrome if it reads the same from right to left and from left...
-
Write a program that prompts the user to enter a file name, reads bytes from the file, and displays each bytes hex representation. (Hint: You can first convert the byte value into an 8-bit string,...
-
Write a program that prompts the user to enter the name of an ASCII text file and displays the frequency of the characters in the file.
-
Start Access. Open the downloaded Access file named Exp19_Access_Ch03_ML1_Small_Business_Loans.accdb . Grader has automatically added your last name to the beginning of the filename. Note this file...
-
Commercial law in Canada list the questions should ask for this case: EMPLOYMENT Holm V. Agat Laboratories Ltd Bailey Gakhal, Brandon Longstreet, Colton Yaremko, Levi Johnson, & Nyah Foote October...
-
What are the underlying molecular processes that govern the remarkable adaptability of prokaryotes to extreme environments, such as those characterized by high temperatures, acidity, or salinity?
Study smarter with the SolutionInn App