首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导159.272程序、讲解Programming编程、java编程语言调试 调试Matlab程序|辅导R语言编程
项目预算:
开发周期:
发布时间:
要求地区:
159.272 Programming Paradigms
Assignment 1
15% Weighting
Due 9 April 2021
Important: this is an individual assignment. You must not share your code with others, or use other’s code (this will be plagiarism!). If we find two assignments that are copied from each other, both assignments will receive Zero marks.
Late submission: There is a penalty for late submissions. The penalty is 10% deducted from the total possible mark for every day delay in submission (one day late – 90%, two days – 80% etc).
You are expected to manage your source code, this includes making frequent backups. “The cat ate my source code” is not a valid excuse for late or missing submissions. Consider managing your code in a private repository (github, gitlab, bitbucket or similar). Set your repository to private (this is essential here to avoid plagiarism), we reserve the right to deduct marks from your submission if the repository is public.
Objectives
This assignment draws on material you have learned through the OOP section of the paper. You will need to apply the following principles to your code:
1.Object Persistence
2.Exception Handling
3.Building User Interfaces
Tasks
In this assignment, you will create a simple student management system.
●Work individually to create the following program in Java using your preferred IDE (Eclipse, intellij etc..).
●Create a project. Inside, create a package assignment1.
Part 1 Domain Model [4.5 marks]
This section creates all the main classes you will need for this assignment.
1.create the following classes in your package (fields should be private):
a.Course, with properties for number and name (both String)
b.Address, with properties for town (String), street (String), post code (String) and house number (int)
c.Student, with properties for surname, first name, id (all String), dob (for “dateOfBirth”, of type java.time.LocalDate), course (of type Course) and address (of type Address)
2.Auto-generate getters, setters, equals and hashCode for all three classes. If two objects are equal, their hashCode should be the same - check that the generated code fulfils this contract.
3.Student should have a clone() method that is a combination of deep and shallow clone: deep clone should be used for the address, a shallow clone should be used for course
Note - LocalDate is immutable like a String. You can clone the Student date using:
clone.dob = this.dob
If you later change the dob on the clone, the original Student will not have its dob changed.
Part 2 Persistency [5 marks]
This section is focused on saving and loading the data we have so we can use it between runs of our programme.
Create a utility class StudentStorage with the following three static methods:
1.Create a class StudentStorage with the following three static methods:
a.void save(java.util.Collection
,java.io.File file) throws IOException – saves a list of students to a binary file. Note that the data of referenced objects (address and course) should be saved as well. Read the hints at the end of the document!
b.void save(java.util.Collection
,String fileName) throws IOException – saves a list of students to a binary file with a given name.
c.No code should be replicated (copied & pasted) between the two versions of save(..) methods.
d.java.util.Collection
load(java.io.File file) throws IOException – reads student data from a binary file.
The save methods should save a collection of students to a binary file with the supplied name. Do not copy paste code between the two versions of save - have one call the other.
The load method reads student data from the file and returns it (if you save students and then fetch them, you should get the original data back).
2.The above methods should preserve referential integrity. For example if two students share a course (i.e. the courses are at the same memory address), when loading the students back from a file, they should still reference the same course object, not two separate course objects (double check by comparing the memory locations of the courses on the fetched students in your Part 3 tests).
Part 3 User Interface [4.5 marks]
The GUI will be the main class of this assignment. It will be how you input information into the programme to create Students and manipulate them.
You may use either Swing or JavaFX for this GUI.
1.write a user interface StudentListEditor to edit lists of students, this is an executable class (a class with a main method) that when executed opens a window.
2.the user interface must show all instances of students represented in a file, and a form that can be used to edit a selected instance for instance. The user interface must have the following functionality:
i.Show the students currently stored
ii.Add new students.
iii.Load information of a selected student.
iv.Delete students.
v.Edit students.
vi.Clone students.
an example of a user interface is shown below:
There is no design requirement for this user interface - as long as it can perform the above functionality and has a sensible flow, it can get full marks. I would recommend using multiple scenes to keep implementation easier, particularly for showing the full information for students.
Part 4: Create a JAR [1 mark]
Create an executable java application studenteditor.jar with StudentListEditor as the main class.
Hint: See http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html for instructions how to create executable jars.
Bounce Part: Testing [2 marks]
This section tests that parts 1 and 2 are working as intended. Doing well in this section means probing that functionality well and considering any edge cases.
2.Write a class TestCloningStudents with JUnit test(s) to test the clone() method in Student.
3.Write a class TestPersistency with JUnit tests to test the save(..) and load(..) methods in StudentStorage. In particular, write tests that “round-trip” data: create a list of Student instances list1, save it, then load it from the file as list2, and compare list1 and list2.
Useful Testing information
●Have a look at the testing lecture on Stream (weeks 6-7)
●Collections don’t have a get() method. But you could cast them to Lists for the purposes of testing multiple objects against each other.
●Use the @AfterClass annotation to delete any files used over the tests and keep your directory clean!
Hints
●you can use code and ideas from tutorials for the first three parts
●for part 2, have a look at the following classes:
java.io.ObjectOutputStream
java.io.ObjectInputStream
3.see http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html for instructions how to create executable jars (for the bonus questions).
4.Make your data classes implement Serializable (a ‘tag’ interface - you do not need to implement any methods, it’s just there as a marker).
How to submit
1.Export the Eclipse project to a file assign1-
.zip, where
is replaced by your student ID. Please use .zip and not another file extension.
2.Check that your zip file contains all project files and java sources by unzipping the file and inspecting its content before you submit , it is also recommended to re-import this as a project into an Eclipse workspace to check this (in Eclipse, use File > Import > General > Existing Projects into Workspace)
3.If you decide to do the bonus question (part 5), also include studenteditor.jar in the root (top) folder of this zip file.
4.Upload the zip file to stream.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!