Join Peggy Fisher for an in-depth discussion in this video Challenge: Ask for lunch choices, part of Learning C++ (2014).
…Are…you ready for our next challenge?…In this challenge, we're going to print out a lunch menu.…It'll have four items along with four prices.…We're going to ask the user to choose an item.…After they select which item they want, they're…going to tell us how many they want.…And then we're going to print out the total cost of their order.…In this challenge, I'd like you to create two parallel arrays.…One array will contain the lunch items,…such as hotdog, hamburger, french fries and salad.…Use a fifth option to allow the user to exit.…Have a corresponding parallel array that has the price of each item, the price of a…hotdog, the price of a hamburger, the price…of french fries, the price of a salad.…Then when the user enters in their choice, you're going…to use the parallel arrays to get the choice they selected.…Find out the cost.…Take the quantity that they ordered.…Multiply it to come up with their total price for the entire order.…And finally print it out.…I hope you have fun with this challenge.…
- Downloading and exploring the C++ IDE
- Working with loops
- Using predefined functions
- Creating custom functions
- Creating and instantiating classes
- Working with external files
Skill Level Beginner
Q: How do I upgrade the C++ compiler on Mac OS X and Linux?
A: Refer to C/C++ Essential Training for a detailed look at installing or upgrading the C++ compiler on various platforms.
Q: The link to download the Eclipse IDE in the "Download a C++ IDE" movie doesn't work. Where can I find the IDE?
A: Short URLs are case sensitive and need to be typed in exactly as they appear. Type in or simply click http://goo.gl/CzckWp to visit the Eclipse IDE for C/C++ Developers page.
1. Getting Started
2. C++ Basics
3. Flow of Control
4. Classes and Objects
5. Data Structures
6. File Manipulation
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.