[Year 12 SofDev] U4O1 - Coding help

Matheson, Heath A Matheson.Heath.A at edumail.vic.gov.au
Wed Jul 17 20:23:31 EST 2013


Hi Peter,

I'm not sure what language you are using but for we use python and tkinter. I would have the order displayed in a listbox and a delete button with a function such as:

def delete_item():
    try:
        # get selected line index
        index = listbox1.curselection()[0]
        listbox1.delete(index)
    except IndexError:
        pass

IMO, validation is an important skill to assess in this outcome. I would suggest a file that contains a list of the menu items that is loaded into an appropriate selection object such as a drop down list (good validation). I would then have quantity as a separate entry. The quantity entry box would also have a type and range check put on it. A button would add the selected item and quantity to an orders 2d array.
For custom items or notes you could have an entry box and a separate button to place additional items into the order.

Here is something similar we made in my class a couple of years ago:
[cid:image003.jpg at 01CE832B.1109CB50]

Hope this helps you out. I'm sure others will have some other ideas. :)
Cheers,
Heath Matheson
Mount Beauty Secondary College


From: sofdev-bounces at edulists.com.au [mailto:sofdev-bounces at edulists.com.au] On Behalf Of Langham, Peter P
Sent: Wednesday, 17 July 2013 1:00 PM
To: Year 12 Software Development Teachers' Mailing List
Subject: [Year 12 SofDev] U4O1 - Coding help

Good afternoon,

I've been working on the Trentham Spud Inn case study available on edulists, created by Elizabeth Wells, as a guide and as practice material for my teaching for U4O1.

In short, it's a Pizza Restaurant ordering system that requires the following tasks:


-          Allow the waiter/waitress to enter the table's order

-          Allow the waiter/waitress to confirm the order with the diners at the table - removing or adding any requested items.

-          Allow special requests to be appended to the order or to individual dishes.

-          Save all of the collected data into a text file

What is the best way to remove an item from the order?

I've been treating the order as one large string, where the diners may place an order as follows:

String Order = "1 x Spudtastic, 1 x Butternut Pumpkin and fresh figs, 1 x Chicken breast and white truffle oil"

I think I'll use a splitting function to separate the string at each comma so we'd end up with

String Order[0] = 1 x Spudtastic
String Order[1] = 1 x Butternut Pumpkin and fresh figs
String Order[2] = 1 x Chicken breast and white truffle oil

To remove the Butternut Pumpkin and fresh figs order

String Order[1] = String Order[2]
String Order[2] = Null or ""

Is there a better way to do this?

Thanks

Peter Langham
Narre Warren South P12



Important - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Early Childhood Development.

Important - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Early Childhood Development.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20130717/e72eafa0/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 13548 bytes
Desc: image003.jpg
Url : http://www.edulists.com.au/pipermail/sofdev/attachments/20130717/e72eafa0/image003-0001.jpg 


More information about the sofdev mailing list