University of Canberra Software Technology 2 2023 Semester 1 Assignment 1
University of Canberra Software Technology 2 2023 Semester 1 Assignment 1
Software Technology 2
2023 Semester 1
Assignment 1
This assignment is worth 20 Marks towards your final assessment.
The first task is just to check you have learned Java acceptably (8 marks)
o To read in the data and store it and then summarise it so we know its read in
correctly
The second task is a computation/formatting problem (2 marks)
o To compute the electricity bill for the flats (not the tenants- but the body corporate)
The third task is a sort problem (2 marks)
o If you do this you must code at least 1 sort routine and 1 search routine (or store
meters in an easy to access data structure that you coded); this is to be indicated in
the reflection report (kind of sort and where you used it and kind of search and
where you used it). The idea is to use this sort/search/datastructure routine to
speed up searches for meters
o To prove the sort you display the first, last and 10 th meter of the test dataset
(mandatory test task3a), this would be index 9 since data structures start at zero.
The fourth task is a search problem (2 marks)
o To compute the bill for one requested flat, showing all tenants in the flat and their
adjusted bills
The fifth task (3marks)
o To compute the bills and summarise them for all flats total and all adjusted Tenants
total.
th
The 6 task is your Reflection report (3 marks).
NOTE: Tasks one to five has a mandatory tests to perform on specified datasets – see the tables for
mandatory testing.
NOTE: I expect the code to compile in BlueJ, if it does not compile and run in that environment,
you will not receive a good grade, I have been known to reduce marks to less than 50% for just
this alone. I also expect to see screen shots of your testing; again I have been known to reduce
marks to less than 50% for failing to evidence your testing.
Authors note :
This is based on the kind of data you get in industry, it may surprise you to know that large
organisations, with large amounts of legacy data , have often ‘messy data’. This is basically a cut
down version of programs I wrote in my career. Electricity billing has changed a lot since then, but
problems like it persist any metering utility.
Development – prefixed with Dev0 or Dev1; these are small versions of the data set for
initial testing, this mirrors the data available to the programmer in a development
environment.
Test - prefixed with test; this is a full size dataset with typical problems such as would be
found in a companies test data base and would be available to the programming team.
Production - prefixed with prod; this is a full size dataset with typical problems such as
would be found in a companies real data base and would be NOT usually be available to the
programming team unless investigating production errors. This is the set of files for most of
your mandatory testing.
This is a sample of the Meter file to help you understand the problems.
Mr,Lewis,Pressman,MT,m163962,223579,08/04/2022,221758,11/01/2022,
Mrs,Diana,Purvis,MT,m163963,536530,08/04/2022,534696,11/01/2022,
Mr,Harvey,Pearce,MT,m163964,157233,06/04/2022,155561,09/01/2022,
Ms,Wendy,Yarwood,MT,m163965,289352,06/04/2022,287997,09/01/2022,
Mr,James,Palmer,MT,m163966,319840,08/04/2022,318156,11/01/2022,
Ms,Dorothy,McBride,MT,m163967,885781,06/04/2022,884413,11/01/2022,
This is a sample of the Flat file to help you understand the problems.
Adelaide Street,11,b239863,705007,07/04/2022,703649,11/01/2022,m163965,
Alma Street,7,b239873,986460,06/04/2022,983395,09/01/2022,m163966,m163967,
Alma Street,8,b239883,595049,06/04/2022,589650,09/01/2022,m163962,m163963,m163964,
I use a menu to control the program, The menu shows the current file being processed, and has the
options shown below.
ST2-2023 Assignment 1
E - Exit
F - Read Flats (Task 1)
M - Read Meters (Task 1)
C - Compute BC Bill For one Flat (Task2)
A - Compute BC Bill For All Flats (Task2)
S - Sort the meter file into meter order (Task3)
O - Compute Full Bill For One Flat (Task4)
5 - Compute Full Bill For All Flats (Task5)
0 - Set Dev0 environment
1 - Set Dev1 environment
2 - Set Test environment
3 - Set prod environment
Select Option:
Task 1
8 marks , We need to be able to get data into the Java program so we can work on it, so you need to
write a program, to read in both data files and store that data in a suitable structure (i.e. java class),
the information needs to be stored in two ArrayLists or Arrays.
To demonstrate you have read the data, it needs to be displayed on a console in summary form and
a count and checksum should confirm all the data is read in and stored accurately.
The report must include the total of meters used eg: Number Of Meters Read in is:6
To compute the electricity bill for the flats (not the tenants- but the body corporate) this is based
entirely on data from the Flat file.
My menu options
You should probably do something similar, but perhaps remove it for the final program!
Task 3
The third task is a sort problem (2 marks)
If you do this you must code at least 1 sort routine and 1 search routine (or store meters in an easy
to access data structure that you coded); this is to be indicated in the reflection report (kind of sort
and where you used it and kind of search and where you used it). The idea is to use this
sort/search/datastructure routine to speed up searches for meters
To prove the sort you display the first, last and 10 th meter of the test dataset (mandatory test
task3a), this would be index 9 since data structures start at zero.
To compute the bill for one requested flat, showing all tenants in the flat and their adjusted bills this
is based on both files the Flat file and the meter file
There are two bill amounts on this Report One is from the main meter the Body Corporate meter
read from the flat file and computed accordingly – in the case shown below this is 1866.1 – which is
9103 usage by the cost at 0.205 $ per kwh.
The second bill amount is the sum of each tenant bill based on usage
When these two are computed there is a difference in the case below this difference is 31.57
This difference is the apportioned to the tenants on the basis of usage (show as usage percent in the
example below, and then added to the tenant bill.
In rare cases the difference is negative in which case it is ignored and the tenant is billed for usage
only.
Mandatory testing for this part is:
Task 5
The fifth task (3marks) To compute the bills and summarise them for all flats total and all adjusted
Tenants total.
In the sample below one can see the only case of a negative difference is ignored
1. The problems you faced and how you got around them please address:
a. How you chose to store the data and why you chose that method;
b. What sort routines you chose
c. The search techniques (if you did the 3 point path search)
2. You must identify any source code used that is not your own (except that code that I have
supplied);
3. You should try to summarise what you learned doing this assignment.
4. Identify what you would do differently or improve on if you had more time.
5. Remember the majority of the program should be your own work.
Further Notes:
IF you are unsure what the program should do ask in a tutorial, and please look at the sample runs to
clarify what the various requested options do.
HINTS:
The other option – S can be done last or can be done – after option a at the students desire
I also used a lot of static variables in a Global class – see tutorial recording Thursday 16/3/2023 for
how to do this it help get around the problems of class visibility – but breaks the ‘pure’ oo model.