CSC1251: Learning About Encapsulation, Inheritance, Polymorphism, and Function Overloading: Advanced Programming Assignment, UOW, Singapore

University University of Wollongong (UOW)
Subject CSC1251: Advanced Programming

Aim

The objectives of this assignment include:

  • Learning about encapsulation, inheritance, polymorphism, and function overloading.
  • Apply the concepts learned by developing a survey and path planning program

Background

In a theoretical flat-land universe, everything is in 2 dimensions. People, animals, plants to planets, moons, galaxies, and even space itself, is in 2D. In our flat-land space (i.e. ‘flat-space), there is a powerful organization called 2D-Starfleet (2DSF), whose goals include seeking out new life and civilization via exploration.

While on a routine mission of exploration, the flagship of 2DSF, the Enterprise-2D is trapped in an expanse of space encircled by a massive ring of a violent, electrical plasma storm. Data coming in from the sensor array reveals that the only opening in this storm is located at the far end of the enclosed area, from Enterprise-2D’s current location.

In addition, the sensor data also revealed that this area is populated by strange, 2D geometrical shapes, with sizes ranging from a small moon, asteroid, to large planets, or even a star! This implies that to travel to the ‘exit’ at the far end of the storm, you need to understand more about the properties of these shapes and attempt to chart a course to navigate to the exit!

As a Science Officer aboard Enterprise-2D, you need to develop a program that has the following capabilities:

a) read in sensor data on the strange 2D shapes (via manual input) b) compute the area (‘mass’) of these shapes c) print shapes report (e.g. list of points: on its perimeter, or totally within shape’s area) d) sort shapes data (sorted by special type and area)

The next section provides information about the requirements for developing this program.

Buy Custom Answer of This Assessment & Raise Your Grades

Task requirement

A) In terms of relative positioning, you may assume a coordinate system with Enterprise-2D at the origin, trying to navigate in a general ‘upper-right direction, to get to the exit in the storm. Please refer to Appendix A, which elaborates on this coordinate system and the unit representation of 2D shapes.

IMPORTANT: For this assignment, you should not assume that the 2D shapes in Appendix A are positioned exactly as shown in Appendix A, nor that there are not more shapes. There will, however, only be shapes of the types listed in Appendix B

B) The sensor data coming in from Enterprise-2D’s sensor array provides crucial information about the 2D shapes such as name, special type, and location of all vertices (that outlines the perimeter of the shape). Please refer to Appendix B, which provides a more detailed description of the sensor data.

C) To assist you in the initial class design of your program, please refer to Appendix C, which illustrates one possible way of designing your program. It also describes a list of requirements which you need to implement, especially those marked under “compulsory”. The classes highlighted in Appendix C are purely meant to store data about the 2D shapes entered into your program by the user.

D) You are required to implement a main driver class called (Assn2I, whose methods are called to start the program. When started, it should print a menu providing the following functionalities

• read in sensor data on the strange 2D shapes (via manual input) • compute the area (‘mass’) of these shapes • print shapes report (e.g. list of points on its perimeter, or totally within shapes area) • sort shapes data (sorted by special type and area) Appendix D provides more information about implementing this class.

E) Once the program is completed and tested to be working successfully, you are highly encouraged to add on “new features” to the program that you feel are relevant to the problem.

Additional marks may be awarded subject to the relevancy and correctness of the new functionalities. ( Note: the additional features will only be considered IF the program has correctly fulfilled all the basic requirements elaborated in earlier.

Deliverables

1) The deliverables include the following:

a) The actual working C++ program (soft copy), with comments on each file, function or block of code to help the tutor understand its purpose.

b) A softcopy word document that elaborates on: • (Interpreted) requirements of the program • Diagram / Illustrations of program design

• Summary of implementation of each module in your program

• Reflections on program development (e.g. assumptions made, difficulties faced, what could have been done better, possible enhancements in future, what have you learned, etc)

c) A program demo/software testing during lab session. You must be prepared to perform certain tasks / answer any questions posed by the tutor.

2) IMPT: Please follow closely, the submission instructions in Appendix E, which contains details about what to submit, file naming conventions, when to submit, where to submit, etc.

3) The software demo/testing will be held during the lab session where you are supposed to submit your assignment. Some time will be allocated for you to present/demonstrate your program’s capabilities during the session.
Grading

Student’s deliverables will be graded according to the following criteria:

(i)Program fulfills all the basic requirements stipulated by the assignment

(ii) Successful demonstration of a working program, clarity of explanation/presentation, and satisfactory answers provided during Q & A session.

Name The name of the 2D shape reveals the general type of shape encountered. Currently, the values consist of : “Square”, “Rectangle”, “Cross” and “Circle”.

Special Type

Enterprise-2D’s sensor has detected that some shapes encloses a ‘warp-space’ with the amazing ability to teleport any objects that touches one of its vertex, to any other vertices of the same shape, instantaneously!
This makes it highly desirable, for Enterprise-2D to travel towards this kind of shape, in the hopes of travelling faster, and saving precious fuel at the same time!

There are only 2 values for ‘special type’ : “WS” (Warp-Space) or “NS” (Normal-Space).

Vertices

The vertices is actually a set of (x, y) points, that describes the outline of the 2D shape. The number of points in the set, depends on the name of the shape. The table below summarizes the kind of sensor data your program expects to receive.

Compulsory requirements

1 The parent class is ‘ShapeTwoD’. Any attributes, constructors and methods specified in the diagram must be implemented, with the exact same name, parameter, type and access!

2 The sub-classes of ShapeTwoD must be named ‘Cross’, ‘Square’, `Circle` and ‘Rectangle’.

3 The method `toString ()’ in class ShapeTwoD is a virtual function that returns a string containing all the values of the attributes in the shape, excluding the array of vertex data. (However, sub-classes of ShapeTwoD must output the array of vertex data, inclusive of any other attribute’s values it inherited)

4 The method ‘computer (1’ in class ShapeTwoD is a virtual function. It must be overridden by the sub-classes and implemented individually.

For example, because each sub-class has a different number of vertices and values, sub-class Cross’s computer () implementation would use a different algorithm/formula from sub-class Square’s computer 0 implementations!

Note: The sensor data will only provide the locations (vertices) of each 2D shape encountered. You will be required to do the necessary research to derive the formula to compute the area for each shape, based on the set of vertex data (i,e. a set of [ x, y ] points) provided!

5 The method ‘isPointOnShape ()’ in class ShapeTwoD is a virtual function. It takes in a [ x, y ] location and returns a boolean value indicating whether the location is totally within the shape’s area. It must be over-ridden by the sub-classes and implemented individually. (Pls refer to sample output in Appendix D).

6 The method ‘isPointOnShape 0′ in class ShapeTwoD is also a virtual function. It takes in a [ x, y location and returns a boolean value indicating whether the location is found on any lines joining the shapes’ vertices! It must be over-ridden by the sub-classes and implemented individually. (Pls refer to sample output in Appendix D).

Other requirements

i) For parent class ‘ShapeTwoD’. You are free to add on any additional methods or attributes deemed necessary for your program to provide its services.

ii) Since the user will key in the name of the shape, it is possible for you to declare arrays of fixed sizes in the sub-classes to store the coordinate vertices of the shape!

iii) You are free to implement any other additional classes you feel necessary so as to provide the required capabilities for this program.

Hire a Professional Essay & Assignment Writer for completing your Academic Assessments

Native Singapore Writers Team

  • 100% Plagiarism-Free Essay
  • Highest Satisfaction Rate
  • Free Revision
  • On-Time Delivery

Get Help By Expert

Are You Looking For someone to write my assignment on CSC1251: Advanced Programming Assignment? then don't worry and hire assignment buddy service at Singapore Assignment Help. We have a highly qualified team of dedicated, reliable, and expert academicians who have years of experience to write all types of homework solutions related to computer science assignments. So hurry up and get a higher rank in your academic area.

Answer

Looking for Plagiarism free Answers for your college/ university Assignments.

Ask Your Homework Today!

We have over 1000 academic writers ready and waiting to help you achieve academic success