Question: I NEED IT TO BE BY DRJAVA PROGRAM Bunch of Lines Objective: Write a bunch of classes that will draw a bunch of lines! Don't
Bunch of Lines Objective: Write a bunch of classes that will draw a bunch of lines! Don't worry you don't have to write any graphics, as that part is provided in the driver. Each line is drawn based on a math function that takes in a given x coordinate and will return its y coordinate First download the driver and put it in your project o DO NOT ALTER THE DRIVER! Write an interface called Line . Create the following method definition o getYPoint: This takes in a decimal value and returns a decimal value depending on the type of line. Write a class called SlopedLine This should implement Line eInstance variable o slope: a decimal value corresponding to the line's slope . Create the following Constructors o Default o Parameterized Constructor Accessors and Mutators for each variable . Create the following Methods o getYPoint this method takes in a decimal value corresponding to a x-coordinate and retums the y-coordinate based on the slope equation (y = slope*x) Write a class called ExponentialLine This should implement Line Instance variable o exponent: a decimal value corresponding to the line's exponent . Create the following Constructors o Default o Parameterized Constructor . Accessors and Mutators for each variable . Create the following Methods o getYPoint this method takes in a decimal value corresponding to a x-coordinate and retums the y-coordinate based on the slope equation (y = x^exponent) Write a class called SineLine . This should implement Line eInstance variable o amplitude: a decimal value corresponding to the line's amplitude o frequency: a decimal value corresponding to the line's frequency . Create the following Constructors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
