File C:/Users/User/Desktop/Spring%2022/0OP/COMP2202_SP2022_HW1_Problem.pdf Gmail O YouTube A Maps لوحة المعلومات - D Page view A Read aloud O Add text V Draw Y Highlight O Erase of 3 Introduction: The equation of a straight line is written as y = mx + b where m is the slope of the line and b is the value of y when x = 0. If there are two coordinate points of the line are given, then it is very easy to compute the line equation. Also you can find the distance between two points. Problem: Write a program to compute lines equation for a set of lines. The number of lines is read from the user. Each line is computed by generating two points randomly using Point2D API. In addition, distance between two points is computed. The program should display a table which include all information about each line. See sample runs below. Take into consideration: 1. Number of generated lines should be greater than zero. 2. Two point objects are constructed only once. Then just update the location of two points for each line using Point2D API methods. 3. x and y values of each point are generated randomly to be less than 100 and greater than 0. 4. Compute the distance between two points using Point2D API methods. 5. A line has two special cases: horizontal line (m = 0), vertical line( m is undefined). Activate Windows Go to Settings to activate Window

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter7: Creating Templates, Importing Data, And Working With Smartart, Images, And Screenshots
Section: Chapter Questions
Problem 3AYK
icon
Related questions
Question

Write a program to compute lines equation for a set of lines. The number of lines is read 
from the user. Each line is computed by generating two points randomly using
Point2D API. In addition, distance between two points is computed. The program should 
display a table which include all information about each line. See sample runs below.
Take into consideration:
1. Number of generated lines should be greater than zero.
2. Two point objects are constructed only once. Then just update the 
location of two points for each line using Point2D API methods.
3. x and y values of each point are generated randomly to be less than 100 
and greater than 0.
4. Compute the distance between two points using Point2D API methods.
5. A line has two special cases: horizontal line (m = 0), vertical line( m is 
undefined).

COMP2202_SP2022_HW1_Proble X
O File | C:/Users/User/Desktop/Spring%2022/0OP/COMP2202_SP2022_HW1_Problem.pdf
M Gmail
O YouTube
A Maps
الوحة المعلومات - . . .*
Page view
A Read aloud
T) Add text
V Draw
9 Highlight
O Erase
2
of 3
Samples run of the program:
Sample 1
Please enter how many line equations you would like to generate: -4
Error: Enter integer value > 0...Try Again
Please enter how many Line equations you would like to generate: 4
Line No
P1(x1,y1)
P2 (x2, y2)
Distance
Line Equation
************
*********
************************************
P1(3.50 , 77.37)
Р1(77.88, 98.96)
Р1(87.99, 60.72)
Р1(67.82, 20. 50)
P2(3.50 , 90. 26)
Р2(85.02, 35. 52)
P2(2.13 , 77.14)
P2(53.78, 20. 50)
1
12.89
x=3.50
у3-8.89х + 790.92
у--0.19х + 77.54
2
63.84
87.41
14.04
y= 20.50
Sample 2
Please enter how many Line equations you would like to generate: d
Error: It is not integer value...Exit
Activate Windows
Go to Settings to activate Windows.
12:56 AM
IJ
P Type here to search
68°F
O G 4) ENG
2/19/2022
近
Transcribed Image Text:COMP2202_SP2022_HW1_Proble X O File | C:/Users/User/Desktop/Spring%2022/0OP/COMP2202_SP2022_HW1_Problem.pdf M Gmail O YouTube A Maps الوحة المعلومات - . . .* Page view A Read aloud T) Add text V Draw 9 Highlight O Erase 2 of 3 Samples run of the program: Sample 1 Please enter how many line equations you would like to generate: -4 Error: Enter integer value > 0...Try Again Please enter how many Line equations you would like to generate: 4 Line No P1(x1,y1) P2 (x2, y2) Distance Line Equation ************ ********* ************************************ P1(3.50 , 77.37) Р1(77.88, 98.96) Р1(87.99, 60.72) Р1(67.82, 20. 50) P2(3.50 , 90. 26) Р2(85.02, 35. 52) P2(2.13 , 77.14) P2(53.78, 20. 50) 1 12.89 x=3.50 у3-8.89х + 790.92 у--0.19х + 77.54 2 63.84 87.41 14.04 y= 20.50 Sample 2 Please enter how many Line equations you would like to generate: d Error: It is not integer value...Exit Activate Windows Go to Settings to activate Windows. 12:56 AM IJ P Type here to search 68°F O G 4) ENG 2/19/2022 近
O COMP2202_SP2022_HW1_Proble x
O File | C:/Users/User/Desktop/Spring%2022/0OP/COMP2202_SP2022_HW1_Problem.pdf
M Gmail
O YouTube
A Maps
الوحة المعلومات  . . .و
Page view
A Read aloud
(T) Add text
V Draw
9 Highlight
O Erase
of 3
Introduction:
The equation of a straight line is written as y = mx + b where m is the slope of the line and
b is the value of y when x = 0. If there are two coordinate points of the line are given, then
it is very easy to compute the line equation. Also you can find the distance between two
points.
Problem:
Write a program to compute lines equation for a set of lines. The number of lines is read
from the user. Each line is computed by generating two points randomly using
Point2D API. In addition, distance between two points is computed. The program should
display a table which include all information about each line. See sample runs below.
Take into consideration:
1. Number of generated lines should be greater than zero.
2. Two point objects are constructed only once. Then just update the
location of two points for each line using Point2D API methods.
3. x and y values of each point are generated randomly to be less than 100
and greater than 0.
4. Compute the distance between two points using Point2D API methods.
5. A line has two special cases: horizontal line (m = 0), vertical line( m is
undefined).
Activate Windows
Go to Settings to activate Windows.
12:56 AM
IJ
P Type here to search
68°F
O G 4) ENG
2/19/2022
Transcribed Image Text:O COMP2202_SP2022_HW1_Proble x O File | C:/Users/User/Desktop/Spring%2022/0OP/COMP2202_SP2022_HW1_Problem.pdf M Gmail O YouTube A Maps الوحة المعلومات . . .و Page view A Read aloud (T) Add text V Draw 9 Highlight O Erase of 3 Introduction: The equation of a straight line is written as y = mx + b where m is the slope of the line and b is the value of y when x = 0. If there are two coordinate points of the line are given, then it is very easy to compute the line equation. Also you can find the distance between two points. Problem: Write a program to compute lines equation for a set of lines. The number of lines is read from the user. Each line is computed by generating two points randomly using Point2D API. In addition, distance between two points is computed. The program should display a table which include all information about each line. See sample runs below. Take into consideration: 1. Number of generated lines should be greater than zero. 2. Two point objects are constructed only once. Then just update the location of two points for each line using Point2D API methods. 3. x and y values of each point are generated randomly to be less than 100 and greater than 0. 4. Compute the distance between two points using Point2D API methods. 5. A line has two special cases: horizontal line (m = 0), vertical line( m is undefined). Activate Windows Go to Settings to activate Windows. 12:56 AM IJ P Type here to search 68°F O G 4) ENG 2/19/2022
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning