Read all instructions! In particular, paragraph rules and recommendations.
's job description is required to implement a program that, through a graphical interface, allowing users to buy tickets rail.
The program has to load from text file, passed as a parameter on the command line, a set of train timetables. The scheduling file is structured as follows:
number timesTimetable example might be:
time partenza1
City partenza1
time arrivo1
City arrivo1
cost biglietto1
time partenza2
City partenza2
time arrivo2
City arrivo2
cost biglietto2
.. . A file
3 10 12
Udine Venice
8 04 05
Bologna Florence
4
Cosenza
22 08 56
Torino
The program, after loading the times oppurtuno a data structure, it must show a graphical interface with a list (
java.awt.List
), a choice ( java.awt.Choice
) and a text area ( java.awt.TextArea
). The list must show schedules loaded, one per line. The choice should allow you to order, in ascending order, the times in the list according to four criteria: - to departure time to time of arrival to departure city
- for the arrival city
Each time you click on a list item, you buy your ticket and the corresponding message is displayed in the textarea
You bought the ticket for the train from ... to .... You start to ... and you come to .... It cost you ... €.(Note: This is not the right way to design interfaces! Is just to simplify your life ... The course of Human Computer Interaction should clarify ideas ...)
Until now you've spent ... €.
Tips
- represented in an appropriate data structure in memory all the time (and then read the file only once at the beginning of the program ...).
- You may need a class
- methods
Integer.parseInt (String)
to convert a string to an integer (for example, the string"5" in
'int
5) andDouble.parseDouble (String) to convert
a string to a double - may be helpful to use the
Reader
with its methods to read from a text file ...
Mode
The level of complexity of the program product can be freely decided by the students; of course, and complex projects will get a better evaluation of simple projects, but we recommend do "just and good" rather than "and so evil" : simple projects can still get the highest score, but well done. The expected duration of work, whereas a group of three people working full time is one week at most.The project should be done in groups of 3 persons (unless special arrangements with the teacher, possible only in cases of genuine and proven need), and all the components of the group must know all the details of the project, as if they had made themselves. It
prepared a short report, preferably (but not necessarily) in XHTML + CSS, on the work. The report must contain:
- A brief analysis of the problem and an intuitive description of your solution (less than 2 pages!).
- Any simplifications made compared to the full request (few lines). The simplifications should be adequately motivated. Obviously, the simplifications will lead to lower ratings, and in some cases (when the simplification is large) projects inadequate.
- Any additions (things no longer required, eg use of components dell'AWT not explained in class, use of Swing, adding features unsolicited, add menus, etc.. etc...) Before adding anything, you think to do well what is required. The reasons for
- all your choices (for example, because you have made a simplification, because you have decided to use some graphical components and not others, why you made certain design choices rather than others, and so on).
- The complete listing of the program, with comments (in javadoc, but not only), written in non-proportional font ( like this: "i" and "m" occupy the same width ) and lined up properly ( "indented").
- A "test implementation "(of about 3 pages) explaining how the program works: an explanation with text and illustrations of how the program works (appearance of the user, such as implementing inadequately explained, etc.).
- with the subject "Project Planning [TWM],"
- in the body containing the names of the components of the project and
- attached ("attach") in a single compressed file (eg. zipped), this report, source code (the files. "java"), and bytecode (the. "Class").
NOTE This project is valid for people wishing to take the exam in the appeal on 24, January 31, 2011, and could be delivered within the deadline. Will not be accepted late for any reason. For subsequent calls will be set up other projects.
Recommendations
contribute to the evaluation of various aspects of project (relevance of the simplifications made, relationship quality, etc..), But it is a priority program of the quality product, especially with regard to the characteristics readability, modifiability ... Examples of criteria for a positive assessment:- The program works?
- resistant to errors of interaction with the user?
- You are able to make small changes in behavior without rewriting a lot of code?
- The GUI is resizable? (Ie: you have not used
setResizable (false)
)? And then you can use on screens of different sizes? - Did you use the layout manager?
- The code is written correctly, and have followed the principles of structured programming, Object Oriented and concealment of information?
- The code is commented? There are enough comments? There are too many comments? Comments are not discounted? The three types of comments in Java have been used correctly?
- You have respected the conventions on the names of identifiers in Java?
- The report is clear?
- The instance variables and class can not be redefined as local variables?
- etc.. etc..
- not declare a variable then if you use it once. You can certainly write a similar program without that variable.
- scriteriatamente not copy the code found on the Internet: anyone can write on the Internet and do not necessarily know what they are doing. Avoid
- maximum
setPreferredSize
. Rather think of a layout that works with any size sane. - Avoid comments like
x = 2 / / 2 ax
check: any programmer knows what it meansx = 2;
! - not use static
- limiting the use of instance variables and class, favorite local variables to methods.
- not use
0 comments:
Post a Comment