Handling bad input data you may not assume that the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: be of the form 2 Note: States names are arbitrarily chosen. 2- letter state codes must be valid if specified. delete <name> searches and deletes all objects with the name field that matches the given <name>. Eg: delete cabbage would delete all entries named cabbage, and output to the screen how many were deleted. search <name> searches for all objects with name field as <name> and then outputs the number of objects found to the screen. update <name> <quantity> updates the quantity field for the first occurrence of a matching name. Eg: update cabbage 10 will change the first occurrence of an object called cabbage to 10, and then output the name and new quantity value for that object to the screen. print will print the contents of the shopping cart in order by name, showing all attribute values for each object as well as the total charges for each. This is followed by the total charges for entire the shopping cart. Output of the shopping cart should be to the standard output st...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online