ANNOUNCEMENTS:
Some of the TAs suggested using the find method, rather than
the in operator.
It is probably easier to use the in operator to check for a
substring in a string, but you may use either in this assignment. We will
discuss find in lecture on Monday.
Your program should ask the user for a menu item, and then report how many calories it contains. If more than one item contains the search term the user enters, you can print them all.
The data also contains a category for each item. The user should be able to find items by category as well as by name, but the output of your program should not display the categories.
This program lets you enter a search term,
which should be a menu item from the Carls Junior
menu. Search terms should be capitalized.
Enter a menu item: Santa Fe
Charbroiled Santa Fe Chicken Sandwich 510 calories
Here is another example.
This program lets you enter a search term,
which should be a menu item from the Carls Junior
menu. Search terms should be capitalized.
Enter a menu item: Hamburger
Double Western Bacon Cheeseburger 900 calories
Famous Big Star(TM) Hamburger 580 calories
Jr. Hamburger 330 calories
Super Star Hamburger 790 calories
Western Bacon Cheeseburger 650 calories
And finally, here is an example where the search term is not in the menu.
This program lets you enter a search term,
which should be a menu item from the Carls Junior
menu. Search terms should be capitalized.
Enter a menu item: pizza
There is no pizza on the menu.
Like last time, hand in your assignment using myUCDavis. Select ECS 10 from your list of courses on the right. Left-click "Assignments" near the upper left, and then "Project 4". Click on "Drop-Off" and then "Browse". Get to your Desktop, and then to the "ECS 10" folder you made, and finally select your file. The file name should appear in the box next to the "Browse" button. Click "drop-off" to hand in your program.
If you are working in the computer classrooms, remember to take your ECS 10 folder, and your program, with you on your flash-drive.