Acsse Csc2a 2021 Sao2
Acsse Csc2a 2021 Sao2
1. You must complete the assessment by yourself within the prescribed time limits.
2. No communication concerning the assessment is permissible during the assessment session except
with ACSSE staff members.
3. You are bound by all university regulations including, but not limited, to assessment, plagiarism, and
ethical conduct.
4. You may not directly take any code from any source, including your own previous submissions. All
code must be written by yourself during the assessment.
5. Answer each question in a separate project.
6. Complete the Honesty Declaration and upload it as part of your submission. The completed Hon-
esty Declaration is required for a submission to be eligible to be marked.
7. Additional time for submission is allowed for as per the posted deadlines on EVE. This additional time
ONLY for submission.
8. This paper contains 3 question(s).
9. This paper consists of 6 page(s) excluding the cover page.
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
Problem statement
The Flying Chicken Airways is designing a system to store and report on information about
its AeroPlanes. The AeroPlane is an abstract class that stores a current load (a random float
between 0.0 and 100.0) and provides a reportLoad operation.
There are two (2) kinds-of AeroPlane:
• CargoPlane stores highest load limit (a random decimal between 35.0 and 75.0)
• Airbus stores total traveler count (a random integer between 100 and 500)
Each kind of AeroPlane performs the reportLoad operation differently:
• CargoPlane prints its current load as a fraction of the highest load limit to the standard out-
put stream.
• Airbus prints its current load times total traveler count to the standard output stream.
A Airline has-an ArrayList of AeroPlanes. Airline contains an addPlane operation to
add instances of AeroPlane to the ArrayList. The Airline also has a reportTotalLoad
operation that will call the reportLoad of each AeroPlane in the ArrayList.
Instructions
For the problem stated above do the following:
1
• Create a UML class diagram that has all the classes with their attributes and operations.
• Create a Java project that contains all the classes with their attributes and operations. Place
the classes in the csc2a.aero.model package.
In the Java project create a Main class that will be the entry point of your program. The Main
class must instantiate a Airline and fill it with ten (10) random instances of AeroPlane.
To determine which instance of AeroPlane to instantiate, create a random integer:
• If the integer is even then create a CargoPlane.
• If the integer is odd then create a Airbus.
After the Airline is filled, call the reportTotalLoad method.
Random values
In order to get a random number create an instance of the java.util.Random class. It has the
following methods (that can be useful to answer the question above):
• nextInt(int bound) - Generate a random integer with an upper limit of bound
• nextFloat - Generate a random float between 0 and 1
♡
1
Constructors, accessors and mutators do not need to be shown in the UML Class Diagram.
Page 1 of 6
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
Submission Guidelines
Your submission for this question must follow the naming convention below:
SURNAME_INITIALS_STUDENTNUMBER_ CSC02A2_2021_Q1
Zip the project and submit the zipfile onto EVE.
Multiple uploads
If you already have submitted once and want to upload a newer version then submit a newer file
with the same name as the uploaded file in order to overwrite it.
Page 2 of 6
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
The Blue JellyFish (BJF) needs a Java Program to automate the processing of WaterCraft in-
formation from its Shipyard. There are two different types of WaterCraft: CruiseShip and
CargoShip. The BJF has already implemented the WaterCraft class and its children in the
provided jar file, BJF.jar. WaterCrafts are stored in text files with the following format:
CruiseShip format
1 //Each element is separated by a TAB character
2 SHIP_NAME SHIP_STYLE CRUISE_PATRONS
CargoShip format
1 //Each element is separated by a TAB character
2 SHIP_NAME SHIP_STYLE CARGO_LOAD CARGO_TYPE
Page 3 of 6
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
Submission Guidelines
Your submission for this question must follow the naming convention below:
SURNAME_INITIALS_STUDENTNUMBER_ CSC02A2_2021_Q2
Zip the project and submit the zipfile onto EVE.
Multiple uploads
If you already have submitted once and want to upload a newer version then submit a newer file
with the same name as the uploaded file in order to overwrite it.
Page 4 of 6
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
The BMH Motors (BMH) wants a Java program that can be used to scan parking for its Park‐
ingLots. The BMH have provided you with a BMH.jar file that contains a set of all the different
AutoMobiles. There are two kinds-of AutoMobile: Cars, Trucks. Each of these classes are doc-
umented in the provided JavaDocs. The BMH requires a program that is capable of scaning a set
of AutoMobiles onto an Canvas using low-level rendering techniques. However, they require a
separation of concerns as functionality cannot be added to the classes in the jar file. You must
therefore implement the Visitor Design Pattern to enable the scaning of AutoMobile objects
onto the canvas. The BMH instruct you to test that the program is able to scan parking such as
the one depicted below:
2
Check the requirement in the JavaDoc for it to be compatible with the BMH.jar.
Page 5 of 6
Computer Science 2A Summative Assessment Opportunity II 2021-04-20
Submission Guidelines
Your submission for this question must follow the naming convention below:
SURNAME_INITIALS_STUDENTNUMBER_ CSC02A2_2021_Q3
Zip the project and submit the zipfile onto EVE.
Multiple uploads
If you already have submitted once and want to upload a newer version then submit a newer file
with the same name as the uploaded file in order to overwrite it.
Page 6 of 6