首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
讲解CSC72002程序、Java编程调试、辅导Programming程序 辅导Web开发|讲解留学生Prolog
项目预算:
开发周期:
发布时间:
要求地区:
CSC72002 Object Oriented Programming - Assignment 2
Weight: 40% of your final mark
Due: 30 September 2020, 11:00 pm
Specifications
Your task is to complete various exercises in NetBeans, using the Java language, and to submit these
via the MySCU link created for this purpose.
Marking criteria includes:
• Use of correct coding style, including the use of comments;
• Accuracy of coding;
• Use of suitable coding structures;
• Correct submission and naming conventions of assessment items as required.
Getting Help
This assignment is to be completed individually. It is the opportunity to gain an understanding of the
concepts of object-oriented programming and coding syntax. It is important that you master these
concepts yourself. You are permitted to work from the examples in the study guide or textbook, but
you must acknowledge assistance from other textbooks or classmates. In particular, you must not use
online material or help from others, as this would prevent you from mastering these concepts.
Who can you get help from? Use this diagram to determine from whom you may seek help with your
program.
Encouraged
Attribution Required
Ask tutor
Not acceptable
2 | P a g e
Please Note for all parts of the assignment:
• You cannot use the same examples that the Study Guide uses. Examples taken from the study
guide will result in no marks and may count as plagiarism.
• Marks will be given for high cohesion. This means that you should not have all your code in
the start method. Your program should make use of multiple methods, each with a distinct
function.
Part 1 – Shapes and Events
Create a new JavaFX project called usernamePart1 in NetBeans. In my case, the project would be
called pdarcyPart1.
Using a GridPane:
• Add at least 4 different shapes to your app (Every shape must have at least 1 event)
• Demonstrate the use of at least 4 different Mouse events
• Demonstrate the use of at least 2 different Key events
• Demonstrate the use of at least 1 inner class
• Demonstrate the use of at least 1 anonymous inner class
• Demonstrate the use of at least 1 lambda expression
• Demonstrate the use of setHgap, setVgap, setHalignment and setValignment
• Ideally, you should have a method for each shape
Part 2 – Images and Animations
Create a new JavaFX project called usernamePart2 in Netbeans. In my case, the project would be
called pdarcyPart2.
• Add an image as the background for your app using an ImageView object
• Demonstrate the use of at least 3 methods of ImageView, e.g. setFitHeight
(https://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/ImageView.html)
• Add a Polygon with at least 8 sides
• Demonstrate the use of the PathTransition class using the polygon as the path and any shape
as the node
• Demonstrate the use of the FadeTransition class to fade the polygon in and out
• Add a second shape (can be any shape) and set the fill to red
• Demonstrate the use of the Timeline class to change the colour of the second shape every 2
seconds indefinitely, e.g. red to blue to red to blue to red etc.
Part 3 – UI Controls and Collections
Create a new JavaFX project called usernamePart3 in NetBeans. In my case, the project would be
called pdarcyPart3.
For this part of the assignment, you need to build an app that stores a collection of Sculptures for a
small exhibition (see the attached class at the end of this assignment). Your app will allow the user
(exhibition’s staff) to enter data about a sculpture. When the user is finished, the data will be written
to a Sculpture object, and then the Sculpture object will be added to a LinkedList. The user can then
enter data for a new sculpture and repeat the process.
2 | P a g e
Your app will need the following UI controls that will be mapped to instance variables in the
Sculpture class provided at the end of this document:
• Text field for the sculpture title
• Text field for the sculpture artist
• Slider for the year created (sculpture creation year, e.g. 2020)
• Radio buttons for the sculpture height (tall (over 5m), medium (shorter than 5m, taller than
1m) and short (under 1m))
• A combo box for sculpture’s weight (Very Heavy, Heavy, Medium, Light, Very Light, etc.)
• A list view for the following four countries of origin of sculptures:
o Italy
o France
o China
o United Kingdom
• CheckBoxes for the material(s) that the sculpture might have (e.g. Stone, Metal, Glass,
Pottery, Wood Carving, Other, etc.)
Once a user has entered the data for a sculpture, your app needs to do the following:
• Write the data from the UI to a Sculpture object (use the attached class at the end of this
assignment)
• Add the Sculpture object to a LinkedList that will store all sculptures entered by the user
• Reset the UI controls so the user can enter a new sculpture
One way to do this would be to have the following (you do not have to do it this way):
• A “New Sculpture” button that resets the UI controls
• An “Add Sculpture” button that creates a new instance of the sculpture, sets the Sculptures
instance variables (via the mutator methods) using the values from the UI controls and then
adds the sculpture to the LinkedList
PLEASE NOTE:
• You CANNOT modify the attached Sculpture class
Part 4 – Parallel Programming
Create a new Java project called usernamePart4 in NetBeans. In my case, the project would be
called pdarcyPart4.
Write a program that uses 4 threads to print out 4 sculpture titles (Donatello’s Equestrian
Monument of Gattamelata, The Terracotta Army, Michelangelo’s David, Maman) in the console, in
parallel, 20 times each author. NOTE: you will not receive any marks if your program does not use
threads.
• Use two different ways to create the threads: by using the Thread class, and by using the
Runnable interface
• Set different priority to each thread (maximum, normal, minimum)
• Write the code to put the threads to sleep for 100 milliseconds each time a sculpture artist is
printed to the console
2 | P a g e
Use of thread pools:
• Create a fixed thread pool that returns a thread pool with a maximum of 3 threads
• Write the code to shut down the fixed thread pool after current tasks are complete and
return TRUE when the shutdown is complete
• Create a cached thread pool that returns a thread pool that creates new threads as required
• Write the code to shut down the cached thread pool immediately and return TRUE if all
tasks in the cached thread pool have been terminated
Avoiding data corruptions
• Assume that there is a possibility of data corruption in this program (data corruption may
not happen in this program). Write the necessary code to your methods to allow only one
thread can execute the code block at one time so that data corruption is prevented. In order
to do so, use both thread Synchronisation and explicit lock object techniques separately.
Submission
You should now have four (4) NetBeans projects. You must zip the projects into one zip file called
username_A2.zip. For example; mine would be pdarcy_A2.zip.
Submit this file via the Assignment 2 link on MySCU by the due date. Please leave enough time for it
to upload, so do not submit at the last minute!
2 | P a g e
Book Class
Use the following class for your Sculpture in Part 3:
public class Sculpture {
// text field
private String title;
// text field
private String artist;
// slider
private Integer yearCreated;
// radio field
private String height;
// combo box
private String weight;
// list view
private HashSet
countryOfOrigin = new HashSet();
// check boxes
private HashSet
material = new HashSet();
public Sculpture() {
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
public Integer getYearCreated() {
return yearCreated;
}
public void setYearCreated(Integer yearCreated) {
this.yearCreated = yearCreated;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
2 | P a g e
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public HashSet
getCountryOfOrigin() {
return countryOfOrigin;
}
public void setCountryOfOrigin (HashSet
countryOfOrigin) {
this.countryOfOrigin = countryOfOrigin;
}
public HashSet
getMaterial () {
return material;
}
public void setMaterial (HashSet
material) {
this.material = material;
}
}
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
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
软件定制开发网!