Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Brief Description This activity amounts to 5 % ( see the course syllabus ) of the entire course grade. So , whatever you obtain as
Brief Description
This activity amounts to see the course syllabus of the entire course grade. So whatever you obtain as a score will be scaled to this value for final grade computation.
With this class activity, we aim to review some objectorientation concepts based on the knowledge you have acquired in COMP ObjectOriented Programming. You will find a grading scheme at the end of this document to guide you on instructor's expectations while preparing your submission.
Problem Definitions
Implementation of Design Options: This problem is adapted from Section of our required text starting on page Assuming you are a software analyst on a project that requires extensive in millions rotation of points and computation of the distance between any two points and performance is key to the success of the project. However, to realize this, you are allowed to store a point either in its Polar or Cartesian coordinates formats. For example, you may choose to store a point in its Polar form but provide interfaces to convert or store it in its Cartesian form and viceversa. In its Cartesian state, you will be storing the and coordinates of the point while you will be storing its distance from a reference point and theta an angle from the reference direction in its Polar state.
COMP : Class Activity Implementing Design Options
Equations show expressions for converting between attributes of Polar ie and and its counterpart Cartesian ie and coordinates. In the figure below, we provide class designs of PointCP and PointCPTest whose implementations can be downloaded from: PointCP PointCP.java and PointCPTest PointCPTest.java.
Table : Alternative designs for PointCP class
tableDesigntableHow Cartesian coordinates are computedtableHow Polar coordinates are computedtableDesign : Store polar coordinates only ie create properties for polar coordinatestableComputed on demand,but not stored with corresponding methodstableSimply returned withcorresponding methodstableDesign : Store Cartesiancoordinates onlytableSimply returned withcorresponding methodstableComputed on demand,but not stored with corresponding methodstableDesign : Abstract superclass with designs and as subclassestableDepends on the concreteclass used.tableDepends on the concreteclass used.
You are required to do the following:
Modify the original implementation of PointCP.java to reflect Design in Table In particular, you will end up with implementations of You are allowed to modify implementations of methods: getDistance and rotatePoint as you deem fit to ensure consistency with other
Step 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