1- Write a Java code that asks the user to enter the integer (x, y) coordinates...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1- Write a Java code that asks the user to enter the integer (x, y) coordinates of two points that form a straight line, reads these coordinates, and calculate the slope (a) and the slope-intercept (b) that form the equation of the straight line as follows: y = ax + b a = (y2 - Y₁)/(x2-X1) b = y2 - a*x2 Then ask the user to enter the integer (XA, YA) coordinate of a point A, read this data, and calculate the distance from this point A to the above straight line: Then you need to get the equation of the line that passes through A and is perpendicular to the original one as follows: The slope of the perpendicular line (ap) is the negative inverse of the slope of the original line: ap = -1/a The slope-intercept (be) of the perpendicular line is calculated by replacing the coordinates of point A into the equation: hectivate Wi Go to Settings 1- Write a Java code that asks the user to enter the integer (x, y) coordinates of two points that form a straight line, reads these coordinates, and calculate the slope (a) and the slope-intercept (b) that form the equation of the straight line as follows: y = ax + b a = (y2 - Y₁)/(x2-X1) b = y2 - a*x2 Then ask the user to enter the integer (XA, YA) coordinate of a point A, read this data, and calculate the distance from this point A to the above straight line: Then you need to get the equation of the line that passes through A and is perpendicular to the original one as follows: The slope of the perpendicular line (ap) is the negative inverse of the slope of the original line: ap = -1/a The slope-intercept (be) of the perpendicular line is calculated by replacing the coordinates of point A into the equation: hectivate Wi Go to Settings 1- Write a Java code that asks the user to enter the integer (x, y) coordinates of two points that form a straight line, reads these coordinates, and calculate the slope (a) and the slope-intercept (b) that form the equation of the straight line as follows: y = ax + b a = (y2 - Y₁)/(x2-X1) b = y2 - a*x2 Then ask the user to enter the integer (XA, YA) coordinate of a point A, read this data, and calculate the distance from this point A to the above straight line: Then you need to get the equation of the line that passes through A and is perpendicular to the original one as follows: The slope of the perpendicular line (ap) is the negative inverse of the slope of the original line: ap = -1/a The slope-intercept (be) of the perpendicular line is calculated by replacing the coordinates of point A into the equation: hectivate Wi Go to Settings 1- Write a Java code that asks the user to enter the integer (x, y) coordinates of two points that form a straight line, reads these coordinates, and calculate the slope (a) and the slope-intercept (b) that form the equation of the straight line as follows: y = ax + b a = (y2 - Y₁)/(x2-X1) b = y2 - a*x2 Then ask the user to enter the integer (XA, YA) coordinate of a point A, read this data, and calculate the distance from this point A to the above straight line: Then you need to get the equation of the line that passes through A and is perpendicular to the original one as follows: The slope of the perpendicular line (ap) is the negative inverse of the slope of the original line: ap = -1/a The slope-intercept (be) of the perpendicular line is calculated by replacing the coordinates of point A into the equation: hectivate Wi Go to Settings
Expert Answer:
Answer rating: 100% (QA)
Heres a Java code that accomplishes what youve described java import javautilScanner public class Li... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Identify each of the equations as representing either a circle, a parabola, an ellipse, a hyperbola, or none of these. (x + 1) 2 + (y + 1) 2 = 2(x + y + 1)
-
An infinitely long cylindrical conductor has radius R and uniform surface charge density . (a) In terms of and R, what is the charge per unit length for the cylinder? (b) In terms of , what is the...
-
What are the definitional differences between CET1, Tier I and Tier II capital?
-
On March 13, 1963, Ernesto Miranda was arrested for kidnapping and rape and taken to a Phoenix police station. After being identified by the complaining witness, he was questioned by two police...
-
Tanger Company purchased a delivery truck for $36,000 on January 1, 2014. The truck has an expected salvage value of $6,000, and is expected to be driven 100,000 miles over its estimated useful life...
-
What is relational algebra? b) What are the types of relational algebra? Question No. 02 a) What is Data definition language (DDL)? b) What is Data manipulation language (DML)? Question No. 03 a)...
-
Determine the magnitude of the resultant force F R = F 1 + F 2 and its orientation , measured counterclockwise from the positive x axis. F = 260 lb 45 F=310 lb 12 5 13 y X
-
Using Lear Corporation's 10Q from October 31, 2022 calculate the following: Use the 9 months income statement data. Assume 91 days a quarter. a) Calculate Days Sales Outstanding (DSO) b) Calculate...
-
Six items purchased at a grocery store weigh 1 0 kilograms. One of the items is detergent weighing 6 6 1 grams. What is the total weight, in kilograms, of the other five items?
-
What steps must a user perform when using the Navigation Bar in QBO to update a Vendors List before entering transactions?
-
1. Prepare a horizontal and vertical analysis of the Balance Sheet and the Income Statement. 2. Based on the results of your vertical and horizontal analyses, which accounts appear out of alignment?...
-
Let f(x,y,z) = x3z yz2. (a) If we start at the point (1,3,2), then in what direction should we move if we want to maximize the directional derivative? (b) What is the instantaneous rate of change of...
-
The following is a dump of a TCP header in hexadecimal format. (05320017 00000001 00000000 500207FF 00000000)16 a. What is the source port number? b. What is the destination port number? c. What the...
-
1. Tests of controls in the finance and investment cycle a. normally focus on tests of transactions b. primarily involve observing physical security of assets c. typically amount to inquiries and...
-
Research an article from an online source, such as The Economist, Wall Street Journal, Journal of Economic Perspectives, American Journal of Agricultural Economics, or another academic journal. The...
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
In 2012, Michael has net short-term capital losses of $2,000, a net long-term capital loss of $45,000, and other ordinary taxable income of $45,000. a. Calculate the amount of Michael's deduction for...
-
Amy is a calendar-year taxpayer reporting on the cash basis. Please indicate how she should treat the following items for 2012: a. She makes a deductible contribution to an IRA on April 15,...
-
On rare occasions, an organism may have three copies of a chromosome and therefore three copies of the genes on that chromosome (instead of the usual number of two copies). The alleles for each gene...
-
Explain how the miR-200 family of miRNAs behave as tumorsuppressor genes. What happens when their expression is blocked or decreased?
-
Outline the steps that occur when piRITS or piRISC silences transposable elements by repressing transcription and by directly inhibiting TE RNAs, respectively. What is the role of piRNAs in this...
Study smarter with the SolutionInn App