CSE105 Coursework 3 2018
Design and codea garden designapplication in Java. Itshould graphicallydisplay
a ‘garden’ ina JFrame window.
The ‘garden 'is contained in a JFrame.It should contain othercomponents
for graphics, painting etc.
It canhave a blank background, or pretty grass/a texture.
It will contain flowerbeds.
Flowerbeds display rowsof flowers. They can beall thesame, or mixed.
If mixed, theycould be in patterns, or random. The example below shows
2 plainflowerbeds at the top, and 2 flowerbed patternsbelow
It is possibleto achieve a maximum of80% without displaying flowers in
patterns (ie plain bedswith only one type of flower per bed). This would
be a good approach for studentswho have lower coding skills.
You should pay attention to applying principlesof OOP as taught this semester,
particularly class design and structure. You may re-use and re-purpose code and
classesdeveloped and used (by you) in the Labsthis semester.
An example of agarden with 4 flowerbeds is shown below. Do not copy it!
The applicationis controlled via a standard command-line menu system,which
allows for the following functionality:
Add flowerbed
Removeflowerbed
Save and exit
Resources
Your application will contain adirectory (folder) containing anumber of suitable
graphicfiles of flowers (up to10). These flowers should be suitable in terms of
size, background-transparency etc.
Your submittedapplication MUST include a textfile which will load a
garden on startup. The garden must contain at least four flowerbeds
containing different flowers. If you donot include this, 40 points are
immediately deducted.
Task Requirements
It should have the following functionality froma menu input system:
Flowerbed Display (10%)
This isa JFrame window, containing a number ofcomponents (panels).Each
component is a flowerbed displaying flowers, asshown in the example
screenshot above. The number of rows and columns depends on thesize ofthe
flower images. When flowerbeds are added and removed, the display should be
updated.
Add Flowerbed (20%)
The user must be able to add a flowerbed to the display.They should be able to
specify:
- Flowerbed size, setting the height and width of the flowerbed.
- Flowerbed location, setting the position on screen (xand y co-ordinates).
- Type of flower (choosing froma menu of flower image file names, which
are in a folderin yourapplication project folder).
To get full marks, theyshould also be able to display flowers in a pattern(as
shown in the lower flowerbeds in the screenshotabove).
The user shouldbe ableto choose the type of pattern (eg squares or stripes)
And also the details ofthe pattern, eg:
Horizontal or verticalstripes?
How many flow different colours or flowers forthe stripes?
Or similar details for squaresetc.
RemoveFlowerbed (5%)
Using acommandline menu, the user canremove flowerbeds from the display.
How this is achieved is up to you. Top marks will go tosolutionswhich identify
the flowerbeds available for removal inthe clearest way.
Save and exit (5%)
The user shouldbe ableto select an exit option in themenu.This will
automatically save the current state ofthe garden to atext file and exit the
program. The file format must be a text(.txt) file.
Load file on startup (5%)
When the program is started, garden data shouldbe automatically loadedfrom a
text file, and the display and flowerbeds should be restored tothe state of the
programwhen itwas last exited.
Menu Interface (10%)
This must be entirely menu driven, displayed through the console windowand
with keyboard input andall user input must be fully validated.The menu must
be clear and usable, with prompts to the user so that it is obvious howtouse the
program. The flower type menu options should bea list of the flower images in
the directory.
Input Validation and Exceptionhandling (15%)
The user input must be fully validated. That means you should check for(and
recoverfrom) user input of:
The wrong datatype (eg float or string instead of int)
The wrong datarange (eg negative or very large numbers for location or
width)
Blank input
If any exceptions are thrown asa result of wrong input (eg an int is required,
and a String orblank is input)the exception must be handled so that the
application doesn’t crash, andthe user can recover the situation.
There should also be further validationthat just the data type.For example,
bounds checking:
- Are the x, y values visible on screen?
- Are the size values within a reasonable range?
Design Documentand Code Quality (30%)
A design document should be submitted. This should be a word document that
gives asimple UML diagram detailing the classes (theirnames, attributes,
methods), and also the relationships between them.
In addition, the code should follow clear conventions for variable names,
comments, indentation, and should be easily readable.
Core Task requirements (required to achieve 40%+)
The submitted file must be a valid NetBeans project folder, includingall
resources.
The project must compile andrun in Netbeanswith no further configuration
and debugging.
The application you submit MUST include a textfile toload a garden on
startup. The garden must contain at least four flowerbeds containing
different flowers. If you do not include this, 40 points are immediately
deducted.
The submissioninstructions must be followed exactly.
Submission
You must submityour work to the submissions drop-box on the CSE105 ICE
page before 8.00pm on 14th December 2018.
You must submit:
One design document (aWord document) with a simple UML diagram
detailing the classes and the relationships between them.
One .txt file for each .java class file. Thesedocuments must NOT be in a
ZIP or RAR archive. Thefile name must be the class name. Each file must
have your name/student number in a comment at the top.
One ZIP or RAR archiveof yourentireNetbeans project folder.Make
sure this contains ALL the resources your application needs to run,
including your flower image resources and a txtfile to load a garden
on startup.
If your program does not compile and run from this zip file only, you
cannot pass (See Core Task Requirements). The zip file name must start
with your student number.
This assignment is individual work. Plagiarism (e.g. copying materials from
other sources without proper acknowledgement) is a serious academic
offence. Plagiarism andcollusion will not be tolerated and will be dealtwith in
accordance with the University Code of Practice on Academic Integrity.
Individual students may be invited to explain parts of their code in person, and if
they fail to demonstrate an understanding of the code, no credit will be given for
that part of the code.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。