Assignment title: Information


CP1404/CP5632 SP1 Assignment+1+©+2016 – Information+Technology+@+James+Cook+University 1/4 CP1404 2016&SP1 Assignment&2 – Items&for&Hire – GUI& Task:

Create a Graphical User Interface (GUI) version of the item hiring program you made in assignment 1, using Python 3 and the Kivy toolkit, as described in the following information and accompanying screencast. In the first assignment you developed and tested core functionality, some of which you

will reuse here. This assignment will help you build skills using classes and GUIs as well as giving you more practice using techniques like selection, repetition, exceptions, lists, tuples and functions.

Program&Features: Ensure that your program GUI has the following features, as demonstrated in the screenshots below and accompanying screencast: • the left side of the screen contains buttons for the user to choose actions from

• the right side contains buttons for each of the items, colour-coded based on their availability • when the user adds a new item, a popup screen is opened that contains the input field, and this closes when the user saves or cancels

• a status bar at the bottom of the screens shows messages • the exact layout and style (including colours) is up to you, but ensure that all functionality is readily accessible with your chosen GUI style. Functionality&Details: • The program starts by loading the same CSV (Comma Separated Values) file of items as in

your first assignment. This should be done using the same actual loading function imported from your first assignment file.

• The items file is saved when the program ends. Import and use the same function your first assignment used to save the file. o Note: if you don't complete the loading and saving functions correctly in the first

assignment, then you can edit and improve these for assignment 2, but you must still import them from your first assignment file. • The screencast demonstrates the required functionality in more detail; here is a summary: Listing:

• Clicking on an item displays its details in the status bar Hiring: • Clicking on an item that is available for hire (in) selects it (button stays down) ready for hiring, and clicking on it again deselects it. The selected items and the total cost are displayed in the status bar. • Clicking an item that is currently out displays its details in the status bar

• When items are selected, clicking Confirm hires them, and the program returns to listing. CP1404/CP5632 SP1 Assignment+1+©+2016 – Information+Technology+@+James+Cook+University 2/4 Returning works in a similar way as for hiring but for returning items. No total price is needed.

Adding: • Adding an item is done in a popup with fields for the item's name, description and price. • These fields are all error checked: name and description can not be empty and price must

be a valid, non-negative number. • Then the item should be added to the list of items in stock and appear in the GUI. At the very top of your code file, add a docstring containing your name, date, brief program details

and a link to your project on GitHub. Coding Requirements: • Make use of named constants where appropriate. • You might like to use an Enum to represent the present state of the program.

• Use functions appropriately for each significant part of the program. Remember that functions should "do one thing". • Use exception handling where appropriate to deal with input errors (including entering

numbers and selecting items). • Use a class for Item (in a file called item.py) and a class for ItemList (in a file called

itemlist.py). Create these with appropriate methods and document them clearly with docstrings. • After your program uses your loading function from assignment 1 to load the items from the CSV file, it should then use the Item and ItemList classes to store the data. You will need to convert the data returned by the loading function into something suitable for your ItemList class. Your ItemList object should then be used throughout the program appropriately.

• Use a separate .kv file for your GUI design. Creating the buttons for items should be done from Python, not in the kv file, since it is dynamic. • You should include comments appropriately, including docstrings for all but trivial functions. You do not need comments in the kv file. GUI&Requirements:

The functionality can be achieved with a variety of GUI layouts and styles. You are welcome to customise the GUI, but it should be simple to use, do everything required and match any constraints specified explicitly in these assignment details or the screencast.

Project&Reflection: Use the provided template to write a short reflection on your process and what you learned in completing this coding assignment. The document should be 1-2 pages long and describe in your own words the process you followed as you developed your coding solutions. We are interested in how you developed your code, how you overcame any challenges, and the main things you learned.

Include this in your project folder (and on GitHub) as a Word document or PDF file. Git/GitHub:

You must use Git version control with your project stored in a private repository on GitHub. Note: You can either do this assignment in a new repository or add it in a new branch called "gui" to your assignment 1 repository (that way you don't have to re-add collaborators). Please add your lecturer and tutor as collaborators with write permission so they can access your

repository. You are assessed on your use of version control including commits and commit messages. You must be easily identifiable from your GitHub username. CP1404/CP5632 SP1 Assignment+1+©+2016 – Information+Technology+@+James+Cook+University 3/4 Submission: Submit a zip file containing the entire project directory, including all code (.py, .kv, .csv), your project reflection document, all PyCharm project files and the .git directory Please name the file like: FirstnameLastnameA2.zip e.g. if your name were Miles Davis, the filename would be MilesDavisA2.zip Submit your single zip file by uploading it on LearnJCU under Assessment.

Due: Submit your assignment by the date and time specified on LearnJCU. Submissions received after this date will incur late penalties as described in the subject outline. Integrity: The work you submit for this assignment must be your own. You are allowed to discuss the

assignment with other students and get assistance from your peers, but you may not do any part of anyone else's work for them and you may not get anyone else to do any part of your work. Programs that are detected to be too similar to another student's work will be dealt with promptly according to University procedures for handling plagiarism.

If you require assistance with the assignment, please ask general questions in the #cp1404 Slack channel, or get specific assistance with your own work by talking with your lecturer or tutor. Sample&Output:

Remember to study the screencast provided with this assignment to see how the GUI program should work, what the messages should be, and to learn what is required and what is flexible. !! CP1404/CP5632 SP1 Assignment+1+©+2016 – Information+Technology+@+James+Cook+University 4/4

Marking(Scheme: Ensure that you follow the processes and guidelines taught in class in order to produce high quality work. Do not just focus on getting the program working. This assessment rubric provides you with the characteristics of exemplary, competent, marginal and unacceptable work in relation to task criteria. Criteria Exemplary Competent Marginal Unacceptable Thoughtful and useful

project reflection 6 The project reflection is complete and describes

development and learning well, shows careful thought, highlights insights made during code

development. 4 Project reflection is decent but lacks depth and insight in one or two areas. 2 Project reflection contains some good content but is insufficient in coverage, depth or insight. 0 Many aspects of the project reflection are missing or could be improved. Use of version control 3 Git/GitHub has been used effectively and the

repository contains a number of commits with good messages that demonstrate incremental code development. 2 Minor aspects of the use of version control are

poor. E.g. not enough commits, or meaningless messages that don't represent valuable incremental development.

1 Git/GitHub used but several aspects of the use of version control are poor. 0 Git/GitHub not used. Program Execution GUI layout

3 GUI layout is constructed using the kv language, and contains all of the required widgets. Layout and styles of widgets make

them easy to see and use. 2 There are 1-2 aspects of the widgets or layout that are missing or incomplete.

1 There are 3-4 aspects of the widgets or layout that are missing or incomplete. 0 The GUI layout is very poor or not done. GUI behaviour 3

All GUI widgets behave as required and are coded appropriately. 2 There are 1-2 aspects of the widget behaviour that are missing or incomplete. 1

There are 3-4 aspects of the widget behaviour that are missing or incomplete. 0

The GUI widget behaviour is very poor or not done. Correctness 6 Program works correctly for all functionality required.

4 Program mostly works correctly for all functionality, but there is/are some small problem(s). 2 Program mostly works incorrectly for all

functionality - there are some significant problems.

Program works incorrectly for all functionality required. Quality of Code Identifier naming 3 All function, variable and constant names are appropriate, meaningful and consistent. 2 One or two function, variable or constant names are not appropriate, meaningful or consistent. 1 Three or four function, variable or constant names are not appropriate, meaningful or consistent.

0 More than four function, variable or constant names are not appropriate, meaningful or consistent. Use of code constructs 3

Appropriate and efficient code use, including no unnecessary duplication, good logical choices for control, good use of constants, etc. 2 Mostly appropriate code use but with one or two problems, e.g. unnecessary duplication,

poor control, no use of constants. 1 Three or four problems, e.g. unnecessary duplication, poor control, no constants. 0

More than four problems with code use. Use of functions 3 Functions and parameters are appropriately

used. 2 Functions used, but not very well, e.g. incorrect

parameters or function calls or main code outside main function. 1 Minimal use of functions or other significant problems with functions. 0 No functions used or functions used very poorly. Formatting 3 All formatting is appropriate, including correct indentation, horizontal spacing and consistent vertical line spacing. PyCharm shows no formatting warnings. 2

Some problems with formatting reduces readability of code. PyCharm shows some formatting warnings. 1 Significant problems with formatting reduces readability of code. PyCharm shows formatting warnings. 0 Readability is poor due to formatting problems.

PyCharm shows formatting warnings. Commenting 3 Code contains inline comments where helpful, and meaningful function docstrings and top

docstring containing program details (name, date, basic description, GitHub URL). 2 Comments are mostly appropriate, but there is some noise (too many comments) or some missing program details in top docstring or some inappropriate or missing inline comments

1 Comments are mostly inappropriate - noise (too many comments) or missing. 0 Commenting is very poor either through having too many comments (noise) or too few comments.