CSSE 220---Object-Oriented Software Development
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
CSSE 220---Object-Oriented Software Development
Exam 1 – Graphics Part, March, 2022
Allowed Resources on this part. Open book, open notes, and computer. Limited network access. You may use the network only to access your own files, the course Moodle and the course web pages, the textbook’s site, Oracle’s Java website, and Logan Library’s online books. You may only use a search engine (like Google) to search within Oracle’s Java website - all others uses or accessing websites other than those mentioned above are not allowed.
Instructions. You must disable Microsoft Lync, IM, email, and other such communication programs before beginning the graphics part of the exam. Any communication with anyone other than the instructor or a TA during the exam may result in a failing grade for the course.
You must actually get these problems working on your computer. Almost all ofthe credit for the problems will be for code that actually works. If you get every part working, comments are not required. If you do not get a method to work, comments may help me to understand enough so that you can earn (possibly a small amount of) partial credit.
There are 4 parts to this graphics problem. Carefully read the instructions and examine the screenshots and diagrams before you begin.
Here is a quick overview of what you will be doing in the 4 stages.
Part 1: 30% - Basic Drawing
Part 2: 30% - Drawing with object specific properties
Part 3: 25% - Drawing with additional special properties
Part 4: 15% - Drawing with rotations
Submit all modified files via Moodle.
Graphics Problem
• Read over all these instructions carefully
• Make sure you understand completely what functionality you have to implement before you start coding
• If anything is unclear, simply do your best to follow the instructions and leave comments in your code describing your assumptions
• You can also email your instructor FOLLOWING the termination ofthe exam about the confusion you had
Part 1 (Required to pass) Default Robot (add pack and eyes)
Robots’s body:
The Robot’s center is (DEFAULT_CENTER_X, DEFAULT_CENTER_Y)
The Robot’s height is DEFAULT_HEIGHT
The Robot’s width is DEFAULT_HEIGHT / HEIGHT_TO_WIDTH_RATIO
The default color for a Robot is DEFAULT_COLOR (which is predefined)
new Color(0,155,0)
Robot’s backpack:
The rectangles for the pack and body must be drawn in the correct order to match the appearance at the right. The pack’s width and height are ½ ofthe size of the body. The pack is aligned to the left side ofthe rectangle ofthe body. A pack’s color will always be the same as eyes. See next page for more detailed visual guide to the layout of the rectangles. |
|
Robot’s Eyes:
See next page for more detailed visual guide to the layout of the rectangles.
Supplementary figures zoomed in on Robot’s rectangles and provided dimensions:
Part 2 (Required to pass) Different Robots – You can do this even ifyou did not complete Part 1
Uncomment the Part 2 code in RobotComponent to begin this part
Add a new parameterized constructor for the Robot class that takes 5 parameters:
This may require you to:
• declare new instance variables (i.e., fields) in the Robot class
• make changes to the Robot’s drawRobot method
• create a 0-parameter constructor (using the DEFAULT values found at the top ofRobot class) in order to ensure Part 1 code continues to work correctly
When finished, the Part 1 and Part 2 part ofyour screen should look like the following:
Part 3 Left/Right Orienting Robot - You CANNOT do this part unless you added AT LEAST the pack OR eyes from Part 1
Uncomment the Part 3 code in RobotComponent to begin this part
Add method setOrientation( String orientation) that takes a String as an input. Ifthe String is “LEFT” then you should have the Robot appear to be facing the to the left (eyes aligned to the left, pack aligned to the right), if the String is “RIGHT” then the Robot should have the same appearance as described in Part 1-2. Thus, a Robot will only appear differently than shown in Parts 1-2 IF and ONLY IF the orientation is set to be “LEFT”. (In other words, the default orientation is “RIGHT”)
In addition to creating the method mention above, this may require you to:
• declare new instance variables (i.e., fields) in the Robot class
• make changes to the Robot’s’s drawRobot method
When finished, the Part 3 part ofyour screen should look like the following:
Part 4 Create a Spinning Robot - You CAN do this even ifyou did not complete Part 3
Uncomment the Part 4 code in RobotComponent to begin this part
Add method setRotationFactor(radians) that takes an input value in radians
This may require you to:
• declare new instance variables (i.e., fields) in the Robot class
• make changes to the Robot’s drawRobot method
When finished, Part 4 ofyour screen should look like the following:
A Final High-Resolution image of Solution for easy comparison:
2022-03-27