Write an Exception class called InvalidMenuOption 1.Use a loop that asks for the
ID: 3623266 • Letter: W
Question
Write an Exception class called InvalidMenuOption1.Use a loop that asks for the user if they want to enter a set of end points or quit
2.If they choice the first option-
A. ask the user to enter 4 double values, x1,x2,y1,y2 that is represented the endpoints of a line segment in the xy plane.
B.Compute the length of the line segment by using the distance formula
distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
C.Compute the slope of the line segment using this formula
slope = (y2 - y1)-(x2 - x1)
3.If the user selects the second option, it terminates.
Explanation / Answer
I don't really see how invalidmenuoption class is related to this at all. I think you might be missing some instructions. You also didn't mention what language this needs to be in. I wrote the pseudo-code in c++. The ideas should be similar. I have not used c++ in a long time so math.sqrt function may not work accordingly, but, again this is just a pseudo code. If you want the full code then you must provide more information. while(true){ coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.