0% found this document useful (0 votes)
67 views13 pages

University of Canberra Software Technology 2 2023 Semester 1 Assignment 1

This document describes an assignment for a software technology course involving analyzing electricity billing data. The assignment is worth 20 marks and consists of 6 tasks: 1) reading data files and storing the data, 2) computing bills for individual and all flats, 3) sorting meter data, 4) searching for a flat's bill, and 5) summarizing all flat and tenant bills. Screenshots of testing on sample datasets are required. The document provides sample data file formats and describes expected program functionality through a menu interface. Mandatory tests are defined for each task to demonstrate required capabilities on specified datasets.

Uploaded by

ON DRIVERS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views13 pages

University of Canberra Software Technology 2 2023 Semester 1 Assignment 1

This document describes an assignment for a software technology course involving analyzing electricity billing data. The assignment is worth 20 marks and consists of 6 tasks: 1) reading data files and storing the data, 2) computing bills for individual and all flats, 3) sorting meter data, 4) searching for a flat's bill, and 5) summarizing all flat and tenant bills. Screenshots of testing on sample datasets are required. The document provides sample data file formats and describes expected program functionality through a menu interface. Mandatory tests are defined for each task to demonstrate required capabilities on specified datasets.

Uploaded by

ON DRIVERS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

University of Canberra

Software Technology 2
2023 Semester 1

Assignment 1
This assignment is worth 20 Marks towards your final assessment.

This assignment is 6 different tasks:

 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.

Submitted on Canvas as a single zip file that contains:


 Your reflection report.
 Your source code BlueJ Java solution (typically this is a directory).
 Screen shots of your mandatory testing for each option you claim to have working.

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.

The Data Supplied


I provide 4 sets of data:

 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.

In each dataset the data is in 2 files comma separated files:

 Blocks of flats and addresses; suffixed with flats


 Meter readings; suffixed with meter

The two files have the following format:

 They are comma separated.


 There may be leading or trailing blanks on any field that should be ignored;
 Lines starting with / should be ignored, or if you want you can edit the file and
delete them.
 Lines can have a trailing comma which can be ignored.
Flats File Format

Field Example Notes


Street Birch Grove Street name
Building number 12 Building number
Building meter b240003 The meter number of the flat
current reading 600146 Obviously the current meter reading
current reading date 12/3/2023 current reading date
previous reading 594023 Obviously the previous meter reading
previous reading date 07/1/2023 previous reading date
Tenant Meter1 m163962 The start of a comma separated list of tenant
meters, note a flat can have 1 to 99 tenants
Tenant meter 2 m163980
Tenant meter 3 m163986
.. repeat m163991, m163996 Up to a maximum of 99 (for any premise total)
Tenant meters 4,5,6,

Meter File Format

Field Example Notes


honorific (name prefix) Mr honorific (name prefix)
first name Rupert first name
2nd name, McGuffin 2nd name,
Unused “MT” Corporation name (not used in this
assignment)
Tenant meter number m783451
Current Meter reading 600113
Current Meter reading date 4/5/2022
Previous Meter reading 599012
Previous Meter reading date 6/2/2022

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 checksum is literally the total of all current readings.

The report must include the total of meters used eg: Number Of Meters Read in is:6

Mandatory testing for this part is:

Test Option File Notes


Task1a Read Flats Prod_flat.txt
Task1b Read Meters Prod_Meter.txt
Don’t forget to take and include screenshots.

Sample Screenshots of Task 1 – for the test dataset


Task 2
The second task is a computation/formatting problem (2 marks)

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

C - Compute BC Bill For one Flat (Task2)

A - Compute BC Bill For All Flats (Task2)

Support this task (from test_flat.txt) – Screen shots below:


The number to show for testing is a debug option to help me check that answers are correct I
deliberately left it in to demonstrate how I test – a 0 means no details are show.

You should probably do something similar, but perhaps remove it for the final program!

Mandatory testing for this part is:

Test Option File Notes


Task2a Compute BC Bill For one Flat Prod_flat.txt
(Task2)
Task2b Compute BC Bill For All Flats Prod_flat.txt
(Task2)
Don’t forget to take and include screenshots.

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.

Screens Shots will be provided soon check the Canvas site

Mandatory testing for this part is to be added soon:

Test Option File Notes


Task3a
Task3b
Don’t forget to take and include screenshots.
Task 4
The fourth task is a search and computation problem (2 marks)

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:

Test Option File Notes


Task4a Compute Full Bill For test_flat.txt, Beaconsfield Road,9
One Flat (Task4) test_Meter.txt
Task4b Compute Full Bill For Prod_flat.txt, The Causeway,12
One Flat (Task4) Prod_Meter.txt
Don’t forget to take and include screenshots.

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

The sample run is from Dev1_flat and Dev1_meter


Mandatory testing for this part is:

Test Option File Notes


Task5a Compute Full Bill For test_flat.txt, Full Screen shot all flats
All Flats (Task5) test_Meter.txt
Task5b Compute Full Bill For Prod_flat.txt, Just Screen shot the totals bit not all the
All Flats (Task5) Prod_Meter.txt mess
Don’t forget to take and include screenshots.
Task 6
The refection report:

You should indicate the following in this report:

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:

This is designed to be done in the following sequence:

1. Option m – read meter file


2. Option f – read flats file
3. Option C – Compute BC bill for 1 flat
4. Option A- Compute BC Bill For All Flats (this is really just a total)
5. Option O - Compute Full Bill For One Flat (Task4)
6. Option 5 - Compute Full Bill For All Flats (Task5)

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.

Students have quite a lot of options as to how they do this assignment:

 Do all of the assignment or just tasks 1, 2 and 6 (or more)


 Is information to be stored in ArrayLists or Arrays;
 Should you use a simple sort like a bubble sort or selection sort or a more complex one like
shell Metzner, merge sort or quick sort.
 Will I have coke and pizza while doing it (and can I afford it – perhaps just toast)
 Will I leave it to the last night and fail or hand in really late. (allocate a few days)

You might also like