GENERAL
INSTRUCTIONS
This assignment should be done individually. The assignment consists of two
parts one part is a written submission of code you have written, test plan and
test runs (Part A, worth 25 marks, details in this document), the other writing
a swing program and demonstrating it (part B worth 5 marks details to be
provided Tuesday week 7).
The main purpose of this assignment is for you to code a program in Java
that solves a problem, from a fictional world of the kerbal space program.
You can ask for help during the tutorials and your tutor will be happy to
assist; but they are instructed to try to guide you through finding a solution
yourself rather than giving you an answer.
Students should be aware that I may do some kind of plagiarism check.
Note code must be in BlueJ code written and submitted in any other Java
environment may not be able to be marked.
This assignment is marked by as a submission of a single zip file. It
should be submitted to Canvas by its due date (see above). You need to submit:
·
The java program code as a bluej project
directory;
·
A test plan;
·
Documented results of your test plan;
·
The results of mandatory test runs; and finally
·
A short reflection report on what you learned.
There are no resubmission
options for this assignment.
The grade you will achieve will
depend on the functionality of the submitted program as shown in the marking
rubric later in this document.
Assignment Briefing:
For the purposes of the
assignment we will assume the following:
You are writing a program for the
Kerbal Space Committee. This is the body of kerbals who’s job it is to hand out
contracts and grant money to companies (like the real world spaceX) to do space
science and exploration.
Each proposal for a mission
includes the following details:
Item
|
|
|
|
Sponsor
|
Can be more than one word
|
|
|
Payload type
|
From the payload table
|
|
|
Value/Cost in $
|
Integer in $
|
|
|
Scientific Value
|
In words
|
None, Low, Medium High or VHigh
|
|
Publicity value
|
In words
|
None, Low, Medium High or VHigh
|
|
Description
|
Will usually be more than one
word
|
|
|
The highly efficient Kerbal Space
Committee converts the filled out proposal forms into a numerical value as
follows:
If the Sponsor is Kerbal Trump
or Science Institute
|
Add 2 point to the value
|
|
If the scientific value is low
|
Add 1 to the value
|
|
If the scientific value is
medium
|
Add 2 to the value
|
|
If the scientific value is high
|
Add 3 to the value
|
|
If the scientific value is
vhigh
|
Add 5 to the value
|
|
If the Publicity value is Low
|
Add 1 to the value
|
|
If the Publicity value is
medium
|
Add 1.5 to the value
|
|
If the Publicity value is high
|
Add 2.2 to the value
|
|
If the Publicity value is vhigh
|
Add 3.5 to the value
|
|
If the payload is 3c and
publicity high or vhigh
|
-1.3 to the value
|
To risky to loose a kerbal
|
If the payload is 1c and
publicity high or vhigh
|
-1.1 to the value
|
To risky to loose a kerbal
|
If the Sponsor is Mega Corp
|
+0.9 to value
|
Gives a lot of election funds
to political party
|
If the payload is taxable
|
Multiply final value by 1.1 and
add 1
|
Get government revenue,
Done after all other tests
|
All the proposals to be assessed
by the committee are stored in a file laid out as follows; each proposal is
spread across 2 lines and has 6 values. For each proposal a score is calculated
the scores are compared and the one with the highest score is then approved. If
the highest one is not unique (ie two have the same highest score) the first one
in the file is taken. (ie the one you read in first).
Sponsor, Payload type,
Description
cost$, Science Value ,
Publicity value
|
Example Proposals file containing
three proposals
Kerbal Trump,LG, Lunar gateway
Station
45000,Vhigh,Vhigh
University Of Kanberra,CS,Satelite
Internet to Kanberra
19,000,Low,Low
Iz Getting HOT,SS, Global
Warming Temperature monitor
18000,VHigh,low
|
Launch Payloads
ID
|
Name
|
Destination
|
Taxable
|
SS
|
Scientific Satellite
|
High Orbit
|
No
|
CS
|
Communication Satellite
|
Geosynchronous Orbit
|
Yes
|
3C
|
3 Person Capsule
|
Low Orbit
|
Yes
|
1C
|
1 Person Capsule
|
Low Orbit
|
Yes
|
SM
|
Small Space Station
|
Low Orbit
|
No
|
PP
|
Planetary Probe
|
Planetary Orbit
|
No
|
LG
|
Lunar gateway
|
Lunar orbit
|
No
|
MR
|
Moon Rover
|
Lunar Surface
|
No
|
The only thing common to Mt1/Mt2
is a partial list of payloads.
The file can contain upper and
lower case, so low, Low and LOW are considered the same
Hint: It turned out to be fairly
easy to do test cases in Excel
What you must do:
a)
Write a test plan enough test cases
to convince yourself that the code works;
b)
Write the code;
c)
Test the code and document the
results of the test
d)
Debug the code
e)
Test the code again and document
the results of the test
f)
Debug the code again
g)
Repeat steps E and F till you are
confident of your programs accuracy
h)
Finally when you are happy with
it Run the mandatory test cases and document the results
i)
Write a report (or reports) that
contain the following
a.
Your test plan;
b.
Documentation of your test plan,
and documenting its results;
c.
Evidence of you running the
mandatory test runs and screenshots of the results;
d.
A short reflection report-on what
you have learned; and
e.
An optional feedback paragraph to
me which is not marked.
j)
Finally zip all documents
(including your source code and the bluej project directory) into a single zip
file and load them onto Canvas.
What your program must do:
1.
It must display a menu with 4
options shown below you can add extra debugging options if you desire;
2.
Option:It must have an exit
option;
3.
Option:It must have a compute
value option;
a.
Note that this option does not
include input of the description or of the cost (this is just to make your life
easier)
4.
Option:It must have a Process
Proposals file option;
5.
Option:It may have (for the extra
marks) a ‘process many files’ option.
a.
The recommendation is for the
highest of all processed files
b.
The list must include the
filename of the proposal
6.
The menu must loop so it can do
repeated calculations without restarting;
7.
The
output must be well formatted in this case both a straightforward answer and
also list of the proposals and their score;
8.
It should edit check all input
(the file and any keyboard input), so it does not crash on an error but instead
gives a suitable error message.
Example
Test Case 1
Sponsor:Kerbal Trump,
Payload: LG
Scientific Value: Vhigh
Publicity Value: Vhigh
|
Value
|
Set proposal value to 0
|
0
|
If the Sponsor is Kerbal Trump or Science
Institute +2
|
2
|
Science value Vhigh
|
2+5 = 7
|
Publicity value Vhigh
|
7+3.5 = 10.5
|
If the payload is 3c and publicity high or vhigh
|
10.5
|
If the payload is 1c and publicity high or vhigh
|
10.5
|
If the Sponsor is Mega Corp
|
10.5
|
If the payload is taxable (no)
|
10.5
|
|
|
Test Case 2
The following test case is worked through for you for the option ‘a
compute value:
Sponsor:University Kanberra,
Payload: CS
Scientific Value: low
Publicity Value: low
|
Value
|
Set proposal value to 0
|
0
|
If the Sponsor is Kerbal Trump or Science
Institute
|
0
|
Science value low
|
1
|
Publicity value low
|
1+1
|
If the payload is 3c and publicity high or vhigh
|
2
|
If the payload is 1c and publicity high or vhigh
|
2
|
If the Sponsor is Mega Corp
|
0
|
If the payload is taxable (no)
|
2*1.1+1 = 2.2+1=3.2
|
|
|
Test Case 3
Process file testcaseK1.txt
Test Case 4
Process file testcaseK2.txt
Test Case 4 (for optional ‘process many files’ option)
Process file testcaseK2.txt and file testcaseK3.txt
Mandatory Testing
You must run and evidence the output of the following tests:
Mandatory Test 1 - compute value
|
Fred,3c,Science=Vhigh,Publicity=low
|
Mandatory Test 2 - compute value
|
Science institute,SM, Science=Vhigh, Publicity=None
|
Mandatory Test 3 - Process Proposals
|
Run File testMandA1.txt
(to be put on web site Wednesday 11/7/18)
|
Mandatory Test 4 - Process Proposals
|
Run File testMandA2.txt
(to be put on web site Wednesday 11/7/18)
|
Mandatory Test 5 -
Process Proposals
|
Run File testMandA3.txt
(to be put on web site Wednesday 11/7/18)
|
Optional Test 6 - Process Proposals
(for the Multiple file option)
|
Run Files testMandO1.txt, testMandO2.txt
(to be put on web site Wednesday 11/7/18)
|
Optional Test 7 - Process Proposals
(for the Multiple file option)
|
Run File testMandO2.txt, testMandO3.txt, testMandO1.txt,
in that order
(to be put on web site Wednesday 11/7/18)
|
Sample runs
Marking (This
assignment part is worth 25 marks).
Marking Rubric
Marks
|
Feature
|
8
|
Good test plan and evidence of testing
|
6
|
Your program code, accuracy, functionality and formatting
|
3
|
Reflection Report
|
5
|
Results of mandatory testing
|
3
|
For the correct running of the ‘process
many files’
|
-1 to -3 if the program fails to check the range its input
|
|
-2
|
For the first mandatory test that’s wrong
|
-6
|
If more than 1 mandatory test is wrong
|
-2
|
Program crashes during our testing but it’s an isolated
case
|
Maximum of 12.5 marks for assignment overall
|
Program fatally crashes, wont compile or has a significant
number of gross errors
|
Late submission
|
5% per day up to 1 week then a mark of 0
Watch the web site for late class wide extensions that may
be given
|