Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can some one show me how to write the computer program above by using the Java code? Thanks Q1: Insects [7 marks] You should be
Can some one show me how to write the computer program above by using the Java code? Thanks
Q1: Insects [7 marks] You should be able to do this question after Week 2 (Unit 4) in the course. A101 Write a non-active Processing program (containing no setup() or draw() functions) which will draw an insect (e.g. caterpillar, ladybug, ant, grasshopper, spider, etc.) or an object related to insects (e.g. can of bug spray, butterfly net, etc.) of your own design in the canvas. Keep it simple and abstract. Do not copy the sample image on the right. Make up a design of your own. Your drawing does not have to be very realistic. Be creative. The rules are: It must contain from 6 to 12 shapes (lines, ellipses, rectangles, or other shapes). The sample shown here uses 7 shapes: 1 ellipse, 2 quadrilaterals, 2 circles, and 2 lines. It must contain at least one line, at least one ellipse or circle, and at least one square, rectangle, triangle, or quadrilateral (quad). It should contain several different colours. Use any background colour you like. It should use strokeWeight to adjust the thickness of the line(s). Don't make it too complex. Stick to the limit of 12 shapes. That will make the remaining questions easier. In this question, your object should fill most of the canvas. ASSIGNMENT 1 DEPARTMENT AND COURSE NUMBER: COMP 1010 You must follow the rules below in your program At the top of your program, define three constants SIZE, X_CENTRE, and Y_CENTRE, which will control the size of your object, and its position in the canvas. o The SIZE can be its length, width, or any other suitable dimension that you like. o The coordinates X_CENTRE and Y_CENTRE should control the position of the object in the canvas, by defining some central point like the middle of the main shape. It doesn't have to be the exact centre. Define suitable constants for all other dimensions and coordinates needed to draw the object, such as heights, widths, diameters, stroke weights, and the coordinates of corners or the endpoints of lines. All of these constants must be calculated from some combination of SIZE, X CENTRE, and Y_CENTRE (or from constants that in turn depend on these)! They cannot be simple numbers! For example: final int WING_WIDTH = 2*SIZE/3; final int LEFT SPOT X = X CENTRE-2*WING WIDTH/3; You do not need to use constants to define colours. Use the constants you have defined to draw the object. You should be able to change the size of the canvas, or SIZE, X_CENTRE, or Y_CENTRE, and the object should still be drawn correctly at any size and in any location. You can use some arithmetic and small constants like 1 or 2 in your drawing commands. For example, a formula like X_CENTRE+SIZE/2 could be used for an X coordinate when drawing a circle. This will reduce the number of constants needed. Q1: Insects [7 marks] You should be able to do this question after Week 2 (Unit 4) in the course. A101 Write a non-active Processing program (containing no setup() or draw() functions) which will draw an insect (e.g. caterpillar, ladybug, ant, grasshopper, spider, etc.) or an object related to insects (e.g. can of bug spray, butterfly net, etc.) of your own design in the canvas. Keep it simple and abstract. Do not copy the sample image on the right. Make up a design of your own. Your drawing does not have to be very realistic. Be creative. The rules are: It must contain from 6 to 12 shapes (lines, ellipses, rectangles, or other shapes). The sample shown here uses 7 shapes: 1 ellipse, 2 quadrilaterals, 2 circles, and 2 lines. It must contain at least one line, at least one ellipse or circle, and at least one square, rectangle, triangle, or quadrilateral (quad). It should contain several different colours. Use any background colour you like. It should use strokeWeight to adjust the thickness of the line(s). Don't make it too complex. Stick to the limit of 12 shapes. That will make the remaining questions easier. In this question, your object should fill most of the canvas. ASSIGNMENT 1 DEPARTMENT AND COURSE NUMBER: COMP 1010 You must follow the rules below in your program At the top of your program, define three constants SIZE, X_CENTRE, and Y_CENTRE, which will control the size of your object, and its position in the canvas. o The SIZE can be its length, width, or any other suitable dimension that you like. o The coordinates X_CENTRE and Y_CENTRE should control the position of the object in the canvas, by defining some central point like the middle of the main shape. It doesn't have to be the exact centre. Define suitable constants for all other dimensions and coordinates needed to draw the object, such as heights, widths, diameters, stroke weights, and the coordinates of corners or the endpoints of lines. All of these constants must be calculated from some combination of SIZE, X CENTRE, and Y_CENTRE (or from constants that in turn depend on these)! They cannot be simple numbers! For example: final int WING_WIDTH = 2*SIZE/3; final int LEFT SPOT X = X CENTRE-2*WING WIDTH/3; You do not need to use constants to define colours. Use the constants you have defined to draw the object. You should be able to change the size of the canvas, or SIZE, X_CENTRE, or Y_CENTRE, and the object should still be drawn correctly at any size and in any location. You can use some arithmetic and small constants like 1 or 2 in your drawing commands. For example, a formula like X_CENTRE+SIZE/2 could be used for an X coordinate when drawing a circle. This will reduce the number of constants neededStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started