首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写CSIT101、代做Python,c++编程
项目预算:
开发周期:
发布时间:
要求地区:
SCIT
School of Computing and Information Technology
Faculty of Engineering & Information Sciences
CSIT101
Object Oriented Design and Programming
Assignment 1
Objectives:
Practice java programming with classes and objects, constructors, copy
constructors, enum type, array, ArrayList (generic version), overloaded
methods, passing by reference etc.
Task (7 marks)
In mathematics, a set is a collection of distinct elements and elements in a set are not
in order. Here are some examples of sets:
(a) A set of integers, e.g. integerSet = {3, 1, 4, 2}
(b) A set of fruits, e.g. fruitSet = {apple, orange, papaya}
(c) A set of characters, e.g. charSet = {‘A’, ‘m’, ‘&’}
We always enclose elements of sets inside a pair of { }.
Here are some other properties on sets:
(1) A set can be empty, i.e. no element. We call it empty set. In mathematics, we have
a special symbol to denote empty set. Convenient to our design later, we will use { }
to denote an empty set.
(2) When checking an element is inside a set. We call it “belong to”.
(3) If a set contains in another set, we call it subset. For example, {1, 2, 3} is a subset
of {2, 3, 4, 6, 1}. Therefore, empty set is a subset of every set.
(4) The cardinal number of a set is the number of elements in a set.
2
(5) The union of two sets A and B are all the elements belong to A and B, minus the
duplications. For example, if A = {1, 2, 3} and B = {2, 3, 4, 5}, the union is {1, 2,
3, 4, 5}.
(6) The intersection of two sets A and B are the common elements of A and B. Using
the example quoted in (5), the intersection is {2, 3}.
(7) The equality of two sets A and B are all the elements of A are in B and all the
elements of B are in A. Or alternatively, A is the subset of B and vice versa.
(8) The difference of two sets A and B, for example A – B, is those elements in B
should not be in A. For example, if A = {1, 2, 3} and B = {2, 3, 4, 5}, A – B = {1}
and B – A = {4, 5}.
We have all the required properties for our task.
In this assignment, our universal set is the 10 enumeration constants of numbers:
One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten.
Data validation is not necessary in this design, when I want to add in a number, you can
assume that this is a valid number in the enumeration constants; i.e. we have restricted
ourselves in a subset of the above 10 numbers.
The best way to test your design is to develop an educational system to teach some
basic set theory. All the sets used in your design should be randomly generated by the
system i.e., the sizes (also known as cardinal number, from 0 to 10 elements) and the
elements.
Let us explore the following UML diagram for the whole task:
3
Let us look at each of the classes:
(a) Enumeration class NumberType
This is the universal set consists of 10 constants (One to Ten) that a subset is
constructed. Each enum constant has a few descriptions: Arabic numbers (1, 2, 3…),
French numbers, Malay / Bahasa, Spanish … Feel free to change to some other
languages, but I may not have decoder to interpret your mother tongue.
(b) Class Set
We use an array list to represent a set, which is an instance variable defined inside the
class. The normal set operations: belong to, contains, union, intersection, complement,
difference, subset, equality is some of the set’s operations. The toString method
returns a String of some enum constants (can be empty) enclosed between braces and
the getEnumFormat method returns its equivalent to one of the descriptions. You
will see in more detail later when work on one of the set operations.
4
You should use the default constructor to construct an empty set. Do some deep
copying in the copy constructor; you may need this constructor to perform some of the
subtasks.
Only the following methods can be used from the ArrayList:
add, get, contains, remove, and size.
You should fully explore the set operations designed by you once you have
implemented them. In the whole design, though you use an array list to denote a set,
you should not perform too many operations on array list, you should assume that
this list is “implicitly” defined
(c) Main class
We are now ready to present the whole system. You are required to design an
educational system to teach basic set theory. We propose the following interactions for
your system:
When you execute your program, the system will display the info for the universal set
(a call to displayNumberTypeInfo method, display once only) and followed by a
menu (the display of menu is repeated after an operation)
5
When you enter option 0, you will see the following interactions:
A set is generated, and a submenu is displayed. You can now try a few simple set
operations, add an element, belong to operation, display the cardinal number and a
display in enum format. Note that the sub-menu will be repeated after each operation.
Let us enter the option 1 in the submenu,
6
You can see in the above interactions, adding an element which is already inside the set,
the final set remains unchanged; otherwise, this distinct element is added to the set.
Let us explore option 2
For option 3, the system just simply displays the cardinal number:
7
For option = 4: the system invokes another format (to display one of the enum
descriptions) to display the corresponding set’s information:
Let us try option = 4 one more time; a different random format is displayed:
You can continue to stay in the submenu or enter 9 to go back to the main menu.
Let us choose 9 to go back to the main screen to test other operations.
Let us now explore each of the options in the main menu:
In the main menu, you choose option 1:
8
In option 1, the system randomly generates two sets and displays the union of these two
sets.
The same is done for option 2, but evaluate the intersection of the two sets:
Important to note, the main menu is always displayed.
In the following screen shot, you see the notation of an empty set.
9
For option 3, the subset operation:
For option 4, the difference of two sets:
Now, option 5, the complement of a set is done with the universal set. Our universal set
is the set of numbers. The following shows some of the interactions and displays:
10
Option 6 is the set equality. The following shows some of the possible interactions and
display:
Option 7 is for first distributive law:
Distributive Law states that, the sum and product remain the same value even when
the order of the elements is altered.
First Law: A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
We use symbol “I” for intersection in display:
Let us explain the 1st law
11
We first compute the expression on the left-hand side. To do this, you need to
compute (B ∩ C) and then A ∪ (B ∩ C).
To compute the expression on the right-hand side, you need to compute (A ∪ B),
(A ∪ C) and then (A ∪ B) ∩ (A ∪ C).
Option 8 is for second distributive law:
Second Law: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
12
IMPORTANT TO NOTE
Put all your classes in a file called YourName_A1.java and make sure
that this file can be compiled and can be executed. Upload ONLY this file
to Moodle. ALL ZIP FILE SUBMISSION WILL BE REJECTED
NOTE THAT ALL CLASSES SHOULD NOT BE PUBLIC!!!!!
No re-submission will be allowed after grading.
In the above file, remember to put down your name and the following
declaration (some similar contents):
// Tell me if it is your own work, and whether you have passed your
// program to your friends etc
// and willing to accept whatever penalty given to you.
- Wrong file name -0.5 mark
- No declaration, no name etc -0.5 mark
- Failing to demo -1 mark
- Programs’ indentations and alignment of statements -0.5 mark
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
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
软件定制开发网!