Question: Hello, I need help with a python3 lab that I'm doing in PUTTY: *Don't worry about the cgi link thats what I would turn into
Hello, I need help with a python3 lab that I'm doing in PUTTY:
*Don't worry about the cgi link thats what I would turn into the teacher.
Overview Build three classes and a main, each in a separate python source file. A Point class to keep track of coordinates. A Color class to keep track of RGB colors. A Rectangle class to keep track of a Point, a Color, a Width and a Height associated with a rectangle. (This is a solid, filled rectangle) A main.py CGI enabled script the will create a list of 1000 random rectangles and generate the SVG code that will display the rectangles on a web page. Turn in a link to your working CGI program. Requirements O The objects need to be in the files (no caps!) o point.py o color.py rectangle.py You must attach all the .py files in the submission including main.py You must place a link to the main CGI script in the message area of the submission. Using Setter and Getters class Point Contains 2 coordinates across _down Contains setters and getters for those coordinates The constructor will initialize them to both 0. There is code in the file that tests all the methods in the class. class Color Contains 3 color values (from 0 to 255) _red _green _blue Contains setters and getters for those properties. The constructor will initialize them to 0,0,0 Contains a method called SVG () which outputs the string rgb(0,0,0) which can be used inside a tag. Use "Integer functional" There is code in the file that tests all the methods in the class. class Rectangle . Contains a _upperleft (which is a Point object) Contains a _height (which is an integer) Contains a _width (which is an integer) Contains a fill (which is a Color object) Contains a method called SVG() with returns a string that takes the properties and create an SVG rectangle string (This is a solid filled rectangle) Contains setters and getters for all the properties. The constructor will take 4 parameters. thepoint, width, height and fill in that order. There is code in the file that tests all the methods in the class. incomplete ideas for the main (main.py) There will be a separate file that will generate a list of shapes and display them. Here's the necessary HTML & HTTP. Notice all the shapes are in 1 svg tag. # code that creates 1000 or objects and puts them in rectangle_list # that code will generate Point and color objects to build the rectangles print ('') print ('') print ('') Importing Files from somefile import className Only the item ClassName in somefile.py gets Imported. After importing ClassName, you can just use it without a module prefix. It's brought into the current namespace. Take care! Overwrites the definition of this name if already defined in the current namespace! Overview Build three classes and a main, each in a separate python source file. A Point class to keep track of coordinates. A Color class to keep track of RGB colors. A Rectangle class to keep track of a Point, a Color, a Width and a Height associated with a rectangle. (This is a solid, filled rectangle) A main.py CGI enabled script the will create a list of 1000 random rectangles and generate the SVG code that will display the rectangles on a web page. Turn in a link to your working CGI program. Requirements O The objects need to be in the files (no caps!) o point.py o color.py rectangle.py You must attach all the .py files in the submission including main.py You must place a link to the main CGI script in the message area of the submission. Using Setter and Getters class Point Contains 2 coordinates across _down Contains setters and getters for those coordinates The constructor will initialize them to both 0. There is code in the file that tests all the methods in the class. class Color Contains 3 color values (from 0 to 255) _red _green _blue Contains setters and getters for those properties. The constructor will initialize them to 0,0,0 Contains a method called SVG () which outputs the string rgb(0,0,0) which can be used inside a tag. Use "Integer functional" There is code in the file that tests all the methods in the class. class Rectangle . Contains a _upperleft (which is a Point object) Contains a _height (which is an integer) Contains a _width (which is an integer) Contains a fill (which is a Color object) Contains a method called SVG() with returns a string that takes the properties and create an SVG rectangle string (This is a solid filled rectangle) Contains setters and getters for all the properties. The constructor will take 4 parameters. thepoint, width, height and fill in that order. There is code in the file that tests all the methods in the class. incomplete ideas for the main (main.py) There will be a separate file that will generate a list of shapes and display them. Here's the necessary HTML & HTTP. Notice all the shapes are in 1 svg tag. # code that creates 1000 or objects and puts them in rectangle_list # that code will generate Point and color objects to build the rectangles print ('') print ('') print ('') Importing Files from somefile import className Only the item ClassName in somefile.py gets Imported. After importing ClassName, you can just use it without a module prefix. It's brought into the current namespace. Take care! Overwrites the definition of this name if already defined in the current namespace
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Students Have Also Explored These Related Databases Questions!