In a theoretical flat-land universe, everything is in 2 dimensions….

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

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.

For this assignment, you take on the role of a mission planning specialist. You are supplied with statistical data from 2DSF’s deep space observation array, and you need to develop a program that does the following:

a) read in statistical data (via manual input)

b) compute the likelihood of life / civilization evolving in each location

c) prioritize a list of top 5 locations for flat-space exploration

d) compute total travel distance based on priority in c)

You need to develop a minimum of 3 classes : PointTwoD, LocationData and MissionPlan. The next section describes the requirements for each of these classes.

Task Requirements

A) 2DSF has adopted a mapping coordinate system with its current headquarters as the origin. Please refer to Appendix A, which elaborates on this coordinate system, the unit representation and relative positioning of different star systems.

B) The LocationData class helps to store statistical data (such as sun type, no. of earth-like planets, etc) that will be keyed into your program. It also implements a formula to compute a location’s civilization index, to help determine if this star system is worth travelling millions of kilometers to check out. Appendices B & C provides more information about implementing this class.

C) The PointTwoD class helps to store (x, y) coordinate info, and encapsulates a LocationData object that stores the star system data pertaining to the coordinate position. It should be noted that information stored within LocationData objects are classified ‘secret’, and should not be stored / accessed elsewhere, other than via PointTwoD object ! Appendix D provides more information about implementing this class.

D) The MissionPlan class is the main driver class whose methods are called to start the program. When started, it should print a menu providing the following functionalities :

• Allow user to input the statistical data

• Compute the civilization index (based on all statistical data entered so far)

• Print top 5 exploration destinations (based on all location data available)

• Total travel distance (to explore all recommended destinations)

Appendix E 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.

F) You are to use only C++ language to develop your program. There is no restriction on the IDE as long as your source files can be compiled by g++ compiler (that comes packaged in Ubuntu Linux) and executed in the Ubuntu terminal shell environment.

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 learnt, etc)

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

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

3) The evaluation will be held during lab session where you are supposed to submit your assignment. Some time will be allocated for you to present / demonstrate your program during the session.

Grading

Student’s deliverable 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 presentation and satisfactory answers provided during Q & A session.

(iii) Additional effort (e.g. enhancing the program with relevant features over and above task requirements, impressive, ‘killer’ presentation)

(iv) After the submission of deliverables, students will be required undergo an evaluation process (to determine fulfillment of task requirements.) Further instructions will be given by the Tutor during the subsequent respective labs. Please pay attention as failure to adhere to instructions may result in deduction of marks.

Tutor’s note:

In the real working world, satisfactory completion of your tasks is no longer enough. The ability to add value, communicate and/or demonstrate your ideas with clarity is just as important as correct functioning of your program. The grading criteria is set to imitate such requirements on a ‘smaller scale’.

APPENDIX A

(Coordinate System of 2D Star Fleet, in Flat-Space)

APPENDIX B

(Implementation info for : LocationData)

Note :

The section below describes the compulsory requirements for class constructors, attributes and methods. However, you are free to implement any additional attributes / methods, as long as it is related to the purpose of the class.

Class Name : LocationData

Attributes :

Name
Type
Remarks
sunType
String
Different types sun has great influence on the possibility of life in the star system.
noOfEarthLikePlanets
integer
The bigger this number, the better the chances that life can be found
noOfEarthLikeMoons
integer
The bigger this number, the better the chances that life can be found
aveParticulateDensity
float
Refers to density of particulates like sand, rocks, asteroids over the area of the star system. The lower the number, the better
avePlasmaDensity
float
Refers to the density of radiation and gases averaged over the area of the star system. The lower the number, the better

Constructors :

1st Constructor –

no parameters. Initialize all String variables to empty string, all int and float variables to 0.

2nd Constructor –

5 parameters. Initialize all attribute variables to the parameter’s values respectively.

Methods :

Assessor (get) and Mutator (set) for each attribute(s)
toString() method that returns a String, containing the name of each attribute and its value respectively
static method computeCivIndex() Note : refer to Appendix C, for this method’s algorithm!

APPENDIX C

(Implementation algorithm for : computeCivIndex())

Return type

A float value, (the higher this value, the greater the possibility of life in the star system)

Parameters (arguments)

1st Parameter : sunType, String

2nd Parameter : noOfEarthLikePlanets, integer

3rd Parameter : noOfEarthLikeMoons, integer

4th Parameter : aveParticulateDensity, float

5th Parameter : avePlasmaDensity, float

Algorithm

1st step, is to convert sunType into a percentage value ‘sunTypePercent’, based on the table below.

sunType
%-tage value

(possibility of supporting life …)
“Type O”
30%
“Type B”
45%
“Type A”
60%
“Type F”
75%
“Type G”
90%
“Type K”
80%
“Type M”
70%

2nd step, is to compute based on the formula below:

Civ. Index =

[ (sunTypePercent / 100) – (aveParticulateDensity + avePlasmaDensity) / 200 ] x

[ noOfEarthLikePlanets + noOfEarthLikeMoons ]

E.g. Assuming :

sunType = “Type B”, aveParticulateDensity = 20%, avePlasmaDensity = 50%, noOfEarthLikePlanets = 5, noOfEarthLikeMoons = 10, then

Civ. Index = [ (45/100) – (20 + 50) / 200 ] x [ 5 + 10 ] = 1.5

APPENDIX D

(Implementation info for : PointTwoD)

Note :

The section below describes the compulsory requirements for class constructors, attributes and methods. However, you are free to implement any additional attributes / methods, as long as it is related to the purpose of the class.

Class Name : PointTwoD

Attributes :

Name
Type
Remarks
x
integer
The x-ordinate of the candidate star system, w.r.t. 2DSF’s HQ (origin)
y
integer
The y-ordinate of the candidate star system, w.r.t. 2DSF’s HQ (origin)
locationData
LocationData
The statistical data about the star system, tied to this (x, y) coordinate
civIndex
float
The computed civilization index value should be stored here

Constructors :

1st Constructor –

no parameters. Initialize all String variables to empty string, all int and float variables to 0.

2nd Constructor –

3 parameters. Initialize all attribute variables to the parameter’s values respectively.

Methods :

Assessor (get) and Mutator (set) for each attribute(s)
toString() method that returns a String, containing the name of each attribute and its value respectively

APPENDIX E

(Implementation info for : MissionPlan class)

This class contains the main () method which declares and instantiates all other classes (i.e. LocationData, PointTwoD) and sets up all the necessary interactions to perform its task.

The figure on the left describes a sample interaction between the main menu and ‘Input statistical data’ sub-menu

The figure on the right describes a sample interaction between the main menu and ‘Compute civ. index value (for all records)’ function.

Note : The example assumes the case where there has only been 3 statistical data records input so far, hence, the message that ‘3 records were updated’!

The figure on the right describes a sample interaction between the main menu and ‘Print top 5 exploration destinations’ function.

Note : The example assumes the case where there has only been 3 statistical data records input so far. Hence all records are displayed, sorted in descending order by Civ Idx value!

The figure on the right describes a sample interaction between the main menu and ‘Print total travel distance’ function.

Note 1 : The formula to compute a straight line distance between 2 points on the map is …

Note 2 : Assuming there are only

3 records with Civ Idx computed,

the total travel distance would be :

dist (HQ to Star Sys. 1) + dist (Star Sys. 1 back to HQ to re-fuel) +

dist (HQ to Star Sys. 2) + dist (Star Sys. 2 back to HQ to re-fuel) +

dist (HQ to Star Sys. 3) + dist (Star Sys. 3 back to HQ to re-fuel)

= 2 (d1 + d2 + d3)

Note 3 : If there are more than 5 records (e.g. 15), then total travel distance should compute the total distances for the trips to the top 5 exploration destinations output by your menu choice 3) !

APPENDIX F

Submission Instructions (V. IMPT!!)

1) Deliverables

a) All submissions should be in softcopy, unless otherwise instructed

b) For the actual files to be submitted, you typically need to include the following:

– word document report (e.g. *.doc), save as MS Word 97-2003 format

– the source file(s), (e.g. *.h, *.o, or *.cpp files)

– the executable file, compile into an executable file with *.exe

(e.g. Assn1.exe)

2) How to package

Compress all your assignment files into a single zip file. Please use the following naming format :