[Year 12 SofDev] U4O1 - Coding help

Langham, Peter P langham.peter.p at edumail.vic.gov.au
Wed Jul 17 12:59:56 EST 2013


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20130717/5a878e33/attachment.html 


More information about the sofdev mailing list