Canadian Computing Competition: 2006 Stage 1, Junior #1
At Chip's Fast Food emporium there is a very simple menu. Each food item is selected by entering a digit choice.
Here are the three burger choices: 1 – Cheeseburger (461 Calories) 2 – Fish Burger (431 Calories) 3 – Veggie Burger (420 Calories) 4 – no burger |
Here are the three drink choices: 1 – Soft Drink (130 Calories) 2 – Orange Juice (160 Calories) 3 – Milk (118 Calories) 4 – no drink |
Here are the three side order choices: 1 – Fries (100 Calories) 2 – Baked Potato (57 Calories) 3 – Chef Salad (70 Calories) 4 – no side order |
Here are the three dessert choices: 1 – Apple Pie (167 Calories) 2 – Sundae (266 Calories) 3 – Fruit Cup (75 Calories) 4 – no dessert |
Write a program that will compute the total Calories of a meal.
Input Specification
The program should input a number for each type of item then calculate and display the Calorie total. The first line will be the customer's choice of burger, the second will be the choice of side, then drink, then dessert. You may assume that each input will be a number from 1 to 4. That is, each customer has to pick exactly one number from each of the four options out of each of the four categories.
Output Specification
The program prints out the total Calories of the selected meal, and stops executing after this output.
Sample Input
2
1
3
4
Sample Output
Your total Calorie count is 649.
Explanation
The customer chose Burger #2, Side #1, Drink #3 and Dessert #4.
CCC problem statements in large part from the PEG OJ
Comments
Can someone see why did I failed Test Case 2?
Your Sundae key and value dictionary in your code is incorrect.
This comment is hidden due to too much negative feedback. Click here to view it.
Firstly, you should avoid posting code in the comments: this is unnecessary clutter as anyone who has solved the problem can view your code, and also potential spoilers for those who want to solve the problems.
As for why your code doesn't work, double-check the whitespace of your output.
This comment is hidden due to too much negative feedback. Click here to view it.
I'm the wonderful stupid idiot who made 16 if statements only to realize that I was being stupid. Also, isn't the sample output supposed to be 631 cals? Maybe my calculator is broken so please don't come at meh. Maybe that's why I got everything wrong.
how can you avoid not having 16 if statements???
Python Dictionary
Someone else posted this original comment. It is now removed.
If you read the input specifications, they give you the input for for a side first, then a drink, not the other way around. Hope that fixes your problem :)
This comment is hidden due to too much negative feedback. Click here to view it.
You might be referring to this: https://dmoj.ca/post/103-point-system-rework
I forgot the period!!!!!!
This comment is hidden due to too much negative feedback. Click here to view it.
Your prayers have been answered by google.
Note the word
A burger has 295 calories (according to Google). A sundae has 180 calories (according to Google).
It seems as if the calories were more/less doubled.
This comment is hidden due to too much negative feedback. Click here to view it.
Someone else posted this original comment. It is now removed.
This comment is hidden due to too much negative feedback. Click here to view it.
Lost a ton of brain cells reading that :O
Someone else posted this original comment. It is now removed.
You've posted that like a million times on this question
God reading that hurt my brain
So you're telling me around 270 people got AC while the output is wrong? [explain your logic here]
Rather than asking for help in comments, which severely clutters up the comments stream, you can go to https://slack.dmoj.ca and ask for help in the #help channel. You will be able to get quicker responses and better explanations.