1. Your program reads a file named âdesign.txtâ. Each line of the file describes a specific object to be drawn…
1. Your program reads a file named “design.txt”. Each line of the file describes a specific object to be drawn on the window created by graphics.py. The format of each line is as follows: Object_type, x-location, y-location, color, size Valid Object_type includes “rectangle”, “circle”, “star”, “triangle”. Size filed varies depending on the given Object_type. This is an example of design.txt file: rectangle, 100, 200, red, 50, 100 circle, 300, 400, blue, 10 triangle, 250, 450, gray, 40 star, 300, 500, yellow, 20 Note that, in rectangle, size has two values 50 (height) and 100 (length). In circle, size has one value 10 (radius). In triangle, size has one value 40 (side of a equilateral triangle). In star, size has one value 20 (side of a equilateral triangle to draw a star). 2. In a loop, your program reads a line in design.txt per iteration until reaching the end of file. After reading a line, your program will parse the required data to draw an object and call the function to draw the object as described. You can reuse the functions, draw_rectangle() and draw_star(), you created in HW4 but you need to create two more functions draw_circle() and draw_triangle(). You can design the functions as you want as long as it works fine. 3. Your program must work for any valid input data in design.txt which can be as many as 100 objects. A separate test file which has unknown number of different objects will be used to evaluate your program.
Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.[order_calculator]