Question: CENG 241- Object Oriented Programming Labwork 6 Statement In this labwork, we have two exercises: first, an introductory graphics coding. Second, adding some visualization support
CENG 241- Object Oriented Programming Labwork 6 Statement In this labwork, we have two exercises: first, an introductory graphics coding. Second, adding some visualization support to Polynomial class. You will integrate SimpleDraw library with your code to do this In the first exercise, get two rectangle info from the user, draw these and mark with indices; write" and "2" inside the shapes, with respect to the input order. You will do this by calling functions of SimpleDraw module. Afterwards, we will add 3 methods to Polynomial class. These will be for evaluation at a specific coordinate, getting the degree and drawing. Remarks Benefit from these functions: drawRectangle and drawText of SimpleDraw. By the way, SimpleDraw is located at https://github.com/fstasel/SimpleDraw Dev-C++ users should get https://github.comfstasel/SimpleDraw/tree gnu++branch. Don't forget to add"-lgdi" to your linker flags; this can be done by selecting Project Project Options >Parameters Linker User will write the rectangle info with the following format: a, b, width and he ight. (0, 0) is top-left. Your good old Polynomial class has now a new interface: const int DEGREE MAX 3; class Polynomial public int coeffielents (DEGREE MAX+11 Polynomial add (Pol ynomlal other Polynomial) Polynomlal subtract Polynomial other Polynomial) Po lynomial multiply Polynomial other Polynomial) void read void WEite) int degree float calculate float x) void sampleDraw float start, float end, float step) l2 degree must return the degree of the polynomial. calculate must calculate the polynomial value at a given x. sampleDraw draws graph for the values starting from start ending at end; end exclusive with increment step. start and stop are between-1 and 1. end is between 0 and 1.1,0) is the center of the left boundary. (1, 0) is the center of the right boundary. Scale calculated x and Px) values accordingly. Connect cach subsequent sample with lines We are moving from structured programming to object oriented programming: so, don't make any changes to the method names and arguments. Assume your co-worker has given you a template and requested from you to not to modify the method names
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
