From the course: Programming Foundations: Discrete Mathematics

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Model a lunch order

Solution: Model a lunch order

From the course: Programming Foundations: Discrete Mathematics

Start my 1-month free trial

Solution: Model a lunch order

- [Voiceover] Okay, how did you make out with the challenge? Were you able to create the datatypes necessary to be able to create an entree and a lunch order? I'm going to show you my version of the solution but remember everybody programs a little differently. I'm gonna start by creating my data types. So I'll do datatype for bread. And the types of bread might include, I don't know, Rye, Wheat, plain old white bread, MultiGrain, and my favorite, Sourdough. Next, I need a list of the types of meats that might be in the sandwich. And that might be Ham. Maybe even some Pepperoni. Maybe some Salami, Bologna. And let's go ahead and add some Turkey. Okay, now we need the Cheese. And the types as we offer is American, Provolone, Cheddar, PepperJack, and Swiss. And finally, we need a list of the condiments that the user can choose from. Maybe they want Pickles. They might want Lettuce. They might want Tomato. Maybe a Relish, Onions and Mustard, Mayo. Oops, looks like I have an error…

Contents