Programming does not always happen smoothly, sometimes a lot of patience, devotion and perseverance are required to solve programming problems and stumbling blocks on your way of creating a new programming solution.While developing an application you might come across a number of programming questions the answers to which are not easy to be found. To spare yourself the trouble, submit your programming questions here and you will get programming answers within the shortest time period.
Ask Your question
Search & Filtering
J = (A+B)*C-D/E
Function should throw an exception if two lines are same or are parallel and hence have no point of intersection. For this, you will need subclasses EqualLines and ParallelLines of the class RunTimeException (declaration on page 97 of the text). The message part of the exceptions should be "The lines are equal: infinite intersection" for EqualLines and "The lines are parallel: no intersection" for ParallelLines. When either exception is caught, the messages will be printed. This will occur in the program that uses the Line class. The class methods should not produce any output.
The first line will have one asterisk, the next two, and so on, with each line having one more asterisk than the previous line,up to the number entered by the user.For example, if the user enters 5, the output would be:
* * *
* * * *
* * * * *