· 10 years ago · Sep 19, 2016, 02:04 AM
1Project 1: Cupcakes
2EECS 183. Fall 2016.
3eecs183.org
4Table of Contents
5Overview
6Objectives
7Honor Code
8Grading
9Distribution Code
10Problem Statement
11Ingredient List
12Input: Number of People
13Output
14Number of Batches
15Shopping List
16Expected Cost
17Supporting Functions
18pluralize
19Ingredient Cost and Conversion Chart
20Creating a Project
21Writing the Code
22Testing
23How to Submit
24S’more
25Objective
26Ingredients
27How to Submit
28Additional (yet important!) Information
29Coding Warm-Up
30Where to Begin
31General Tips
32Style Checklist
33Sample Output
34S’more Sample Output
35due Friday, 23 September 2016 at 6:00 p.m.
36
37Overview
38In this project, you are starting your own company that sells cupcakes using an old family recipe passed down through the generations — the “Best Ever Vanilla Cupcakesâ€. Since you expect both small and large orders, you need assistance in figuring out how much to buy for the ingredients for each order. Since this is a start-up, you will be working out of your own small kitchen with limited space to store ingredients.
39
40Start with the Distribution Code. The Additional (yet important!) Information contains a lot of helpful information — we suggest giving it a quick read before starting the project.
41Beware the autograder’s ability to detect cheating, see Honor Code for further information.
42vanilla cupcakes
43Objectives
44To have fun.
45
46To start thinking more carefully.
47
48To understand the use of existing operators to perform interactive I/O using C++.
49
50To implement conversions correctly.
51
52To use constants and variables appropriately.
53
54Honor Code
55All students in the class are presumed to be decent and honorable, and all students in the class are bound by the College of Engineering Honor Code.
56
57You may not seek to gain an unfair advantage over your fellow students;
58
59You may not consult, look at, or possess the unpublished work of another without their permission;
60
61You are not allowed to look at or in any way derive advantage from the existence of project specifications or solutions either for the current semester or for past semesters; and
62
63You must appropriately acknowledge your use of another’s work.
64
65Any violation of the honor policies appropriate to each piece of course work will be reported to the Honor Council, and if guilt is established penalties may be imposed by the Honor Council and Faculty Committee on Discipline. Such penalties can include, but are not limited to, letter grade deductions or expulsion from the University.
66
67Also note that on all cases forwarded to the Engineering Honor Council the LSA Dean of Academic Affairs is also notified. Furthermore, the LSA rule is that students involved in honor violations cannot withdraw from nor drop the course.
68
69We run every submission against every other submission and determine similarities. All projects that are “too similar†are forwarded to the Engineering Honor Council. This happened to numerous students last semester. Also know that it takes months to get a resolution from the Honor Council. Discussion of the project will NOT be an issue. Sharing code between students will likely cause the cheating detector to identify both programs as “too similarâ€. We also search the web for solutions that may be posted online and add these into the mix of those checked for similarities. Searching the web, by the way, is something that we are very good at.
70
71Also note that on all cases forwarded to the Engineering Honor Council the LSA Dean of Academic Affairs is also notified. Furthermore, the LSA rule is students involved in honor violations cannot withdraw from nor drop the course.
72
73Grading
7450 points correctness. Implement your code in cupcakes.cpp. To what extent does your code implement the features required by our specification? To what extent is your code consistent with our specifications and free of bugs? To receive a 5% bonus for this part, submit it no later than Wed 9/21. To receive a 2.5% bonus, submit no later than Thu 9/22.
75
7610 points style. To what extent is your code written well? To what extent is your code readable? Consult EECS 183 Style Guide and check the Style Checklist at the end of this project’s specification for some tips!
77
78We grade your LAST submission only.
79
80This project must be completed individually, i.e., no partners.
81
82Distribution Code
83For this project, you’ll first download “distribution code†written by us, and add your own lines of code to it. You can download it either from the Projects page of the course’s website or by clicking here on project1.zip. After downloading and unzipping it, you’ll find this file:
84
85cupcakes.cpp
86This is basic starter code for Project 1. It #includes has all the necessary libraries and defines a function called pluralize, which will be helpful in printing singulars or plurals of words, e.g. “bag†vs. “bagsâ€, “bottle†vs. “bottlesâ€.
87Problem Statement
88Your task for this project is to create a program that creates a shopping list for baking cupcakes. Your program will assist you with coming up with a list of ingredients for both small and large quantities. And since you are working out of your apartment, there is no space to store extra ingredients.
89
90sam cupcakes
91(http://wolpepers.com/cupcakes-pc-wallpaper-free/)
92
93Ingredient List
94Familiarize yourself with this list of ingredients. To make one batch of “Best Ever†Vanilla Cupcakes (12 cupcakes), you’ll need the following:
95
961 ½ cups all-purpose flour
97
981 cup granulated sugar
99
1001 ½ teaspoons baking powder
101
102½ teaspoon table salt
103
104½ cup unsalted butter (1 stick), room temperature
105
106½ cup sour cream
107
1081 large egg, room temperature
109
1102 large egg yolks, room temperature
111
1121 ½ teaspoons vanilla extract
113
114Additionally, you’ll need these ingredients for Vanilla Buttercream Frosting:
115
1161 cup (8 ounces) unsalted butter, at room temperature
117
1182 ½ cups powdered sugar
119
1201 tablespoon (3 teaspoons) vanilla extract
121
122Input: Number of People
123Before you can buy ingredients, you need to know how many cupcakes you need to make. And to determine this, you need to know how many people you need to serve. Therefore, your program must first ask the user for the number of people with this question:
124
125How many people do you need to serve?
126This is the exact prompt you must use. If yours is different by even one character, you’ll most likely receive a very low score. So we recommend that you copy and paste it.
127
128We assume that the serving size is 1 cupcake per person.
129Output
130The output from your program consists of the following:
131
132Number of Batches
133How many batches you need to make. Remember that one batch makes 12 cupcakes. Note that you cannot make a partial batch of cupcakes.
134
135The output must look like this if you need to make just one batch (12 cupcakes or less):
136
137You need to make: 1 batch of cupcakes
138And like this if you need to make more than one batch (in this case five):
139
140You need to make: 5 batches of cupcakes
141Notice how batch become batches when the number is larger than one. How to do that? We gave you a function pluralize that makes this simple.
142Shopping List
143After printing the number of batches to make, your program must print a shopping list. First, print this header:
144
145Shopping List for "Best Ever" Vanilla Cupcakes
146----------------------------------------------
147Next, print a shopping list containing:
148
149how many bags of flour
150
151how many bags of granulated sugar
152
153how many pounds of butter
154
155how many containers of sour cream
156
157how many dozen eggs
158
159how many bags of powdered sugar
160
161how many bottles of vanilla
162
163For each ingredient in the shopping list, print the quantity you need to purchase, carefully printing either singular or the plural version of words, per these examples:
164
1651 bag of flour
1662 bags of flour
167
1681 bag of granulated sugar
1692 bags of granulated sugar
170
1711 pound of butter
1722 pounds of butter
173
1741 container of sour cream
1752 containers of sour cream
176
1771 dozen eggs
1782 dozen eggs
179
1801 bag of powdered sugar
1812 bags of powdered sugar
182
1831 bottle of vanilla
1842 bottles of vanilla
185Of course if any of the expected output is 1, then the noun following it should be singular. If any of the expected output is larger than 1, then the noun following it should be plural. Remember to use pluralize function described below to do this.
186
187Remember that the plural of dozen is still dozen.
188So that we can automate the testing of your code, the order and verbiage connected with the shopping list and the rest of the program must be the same as presented in this specification. Making sure they are exact is critical to passing the autograder. Check the Sample Output below for the exact prompts. To avoid spelling errors, simply copy/paste the appropriate prompt into your code. Note that a spelling error will cause you to fail almost every test case from the autograder.
189Expected Cost
190After printing the list of ingredients and their quantities, print their total cost and a goodbye message:
191
192Total expected cost of ingredients: $XX.XX
193
194Have a great party!
195You need not ensure that the number of cents is printed to two decimal places.
196Supporting Functions
197pluralize
198Recall the idea of a function. You can think of a function as a black box that accepts 0 or more inputs and gives you back 0 or 1 output.
199
200For example, the sqrt function takes a number and gives you back the square root of that number. To use sqrt function, you have to first #include <cmath> at the top of your code, because sqrt function is defined in the cmath library. You can give sqrt input by putting a value between the parentheses after the function name. Then sqrt will “return†another number that you can use as you’d like: print it, use it in another calculation, etc.:
201
202int n = 9;
203cout << sqrt(n) + 1 << endl;
204The above code will print
205
2064
207Now, back to pluralizing. We’ve written a function to help you pluralize your output. It’s defined at the bottom of cupcakes.cpp (take a peek if you’d like) and all you have to do is call (i.e. use) it. Unlike sqrt that takes just one argument (aka input), pluralize takes 3 arguments, separated by commas:
208
209The singular version of a word.
210
211The plural version of that same word.
212
213A number.
214
215If the number is greater than 1, pluralize will return the plural version, otherwise it will return the singular version.
216
217Here’s a small program that illustrates how to use pluralize:
218
219int numberOfOctopi = 0;
220cout << "Welcome to the 183 Octopus Tickler Program!" << endl;
221cout << "How many octopi would you like to tickle? ";
222cin >> numberOfOctopi;
223cout << "You tickled " << numberOfOctopi << " "
224 << pluralize("octopus", "octopi", numberOfOctopi) << "!" << endl;
225The output will look like the one below, wherein red underlined text represents some user’s input:
226
227Welcome to the 183 Octopus Tickler Program!
228How many octopi would you like to tickle? 1
229You tickled 1 octopus!
230Notice how octopus is printed if the user chooses to tickle just one. And if the user chooses to tickle 3, it will print:
231
232Welcome to the 183 Octopus Tickler Program!
233How many octopi would you like to tickle? 3
234You tickled 3 octopi!
235Ingredient Cost and Conversion Chart
236Figure out how many of each ingredient you need to purchase using the Ingredient List above and this cost and conversion chart:
237
238Ingredient Cost Conversion
2395 lb bag of Flour
240$3.09
24120 cups in 5 lb
2425 lb bag of Granulated Sugar
243$2.98
24410 cups in 5 lb
2451 lb Butter
246$2.50
2472 cups in 1 lb
2488 oz of Sour Cream
249$1.29
2501 cup in 8 oz
251Dozen Eggs
252$2.68
25312 eggs in dozen
2542 lb Powdered Sugar
255$1.18
2565 ½ cups in 2 lb
2572 oz Vanilla
258$4.12
25912 teaspoons in 2 fluid oz
260Baking powder, Salt
261Infinite supply available for no $$$
262You must buy the ingredients only in the amounts listed in the above table.
263
264Since the recipe is in “cupsâ€, and the ingredients are in “poundsâ€, we need to be able to convert between the two. Since “cups†is a measure of volume and “pounds†is a measure of weight, a definitive conversion is not possible. Therefore, we are going to use the above “close enough†conversions.
265
266“lb†is an abbreviation for “pound†due to the Roman weight system. A “pound†of weight in Latin (the language of the Romans) is called a libra pondo. This abbreviation of the Latin term translates into “lb†for “poundâ€.
267Creating a Project
268If you haven’t done so already, read Getting Started with Xcode guide or Getting Started with Visual Studio guide, depending on the operating system you’re using. They will walk you through creating a new project and basic editing.
269
270Once you create a project, you’ll need to import cupcakes.cpp that you’ve downloaded from the Projects page of the course’s website. Dragging it into the project folder is not enough, since your IDE won’t know that the file exists unless you explicitly tell it so by importing the file to your project.
271
272Xcode
273There are a couple of ways to import a file in Xcode. The easiest way, perhaps, is to drag and drop that file next to main.cpp in the Navigator area on the left side of the Xcode window.
274
275xcode drag drop
276Check the checkbox next to Destination: Copy items if needed, make sure that the checkbox next to Add to targets is checked and click Finish.
277
278Alternatively, you can choose File > Add Files to…​ in the menu bar, navigate to your file, select it and click Add (or press Option-Command-A). Make sure that the checkbox next to Add to targets is checked when you are adding .cpp files.
279
280Now there is a problem: there are two main functions in your project: one in main.cpp that was automatically inserted by Xcode when you created a new project and another one written by the staff in cupcakes.cpp that you’ve just imported. Recall that a C++ program must have one and only one main function, so your code will not compile. But not to worry! Just delete main.cpp by right-clicking (or Control-clicking) on main.cpp in the Navigator area on the left side of the Xcode window and choose Delete.
281
282xcode delete main
283Visual Studio
284To add a new file to your Visual Studio project, right-click on Source Files in the Solution Explorer and choose Add > Existing Item…​ (or press Shift-Alt-A).
285
286vs add existing
287Navigate to cupcakes.cpp, select it and click Add.
288
289You should now see the contents of cupcakes.cpp in the Code pane (editing area).
290
291Be sure to add your name, your uniqname and a small description of the program to the header comments.
292Writing the Code
293So now that you have a new project created and cupcakes.cpp in front of you, it’s time to begin! Remember that the execution of a program will begin in the main function, so that’s where you’ll be writing your code — but not before you have thought about the problem.
294
295Below is the beginning of starter pseudocode.
296
297// get the input needed
298// calculate how many batches you will need
299// print out the number of batches --
300// use the exact output expected for batches
301// make sure it is correct -- test on a few test sets
302// fix the singular/plural
303// "batch" if you have 1
304// "batches" if 2 or more
305// test again to make sure it worked
306
307// now add the print needed for "Shopping List ..."
308// and don't forget about all the "----------..."
309// Note: you may want to copy/past those "----"s
310// because if you are off on the count,
311// you will fail the autograder on every test!
312
313// Calculate how much flour is needed
314// How do you do this conversion? What data is needed?
315// Where is the most appropriate location for this code?
316// above the print for the "Shopping List ..." or below it?
317// Do you need to store the result of the calculation in a variable?
318// That answer is "Yes" if you need the result again.
319// The answer is "No" if you don't need the result again
320// Now how do you print how much flour is needed in your shopping list?
321// Test to make sure it is correct
322
323// After you are positive that all the above works perfectly
324// calculate how much sugar is needed
325// test it out
326
327// etc -- one piece at a time
328// test as you go
329When you start small, add in one small piece at a time, and test as you go, it seems very manageable.
330
331Testing
332Remember, a computer does NOT interpret. If you misspell a word, you will fail all test cases with the autograder. If you miss a punctuation mark, you will fail all test cases with the autograder. We STRONGLY suggest you test your code.
333
334So that we can automate the testing of your code, the order and verbiage connected with the shopping list and the rest of the program must be the same as presented in this specification. Making sure they are exact is critical to passing the autograder. Check the Sample Output below for the exact prompts. To avoid spelling errors, simply copy/paste the appropriate prompt into your code. Note that a spelling error will cause you to fail almost every test case from the autograder.
335Here are some inputs to test for. Remember that the serving size is 1 and the number of servings per batch is 12.
336
337Number of people Expected output What it tests
33810
3391 batch
340check for singular on “batchâ€
34112
3421 batch
343check for boundary condition
344check for just enough cupcakes
34513
3462 batches
3472 pounds of butter
348…​
349just over cutoff on how many batches
350also check for plural on “batches†and “pounds†on butter check singulars on with a 1 on all else
35125
3523 batches
3533 pounds of butter
3542 containers of sour cream
3552 bags of powdered sugar
3562 bottles of vanilla
357just over cutoff for how many batches
358check plural on butter
359check plural on sour cream
360check plural on powdered sugar
3614 batches
3623 pounds of butter
3632 containers of sour cream
3642 bags of powdered sugar
3652 bottles of vanilla
3664 batches would be 12 eggs
3675 batches
3684 pounds of butter
3693 containers of sour cream
3702 dozen eggs
3713 bags of powdered sugar
3722 bottles of vanilla
373check plural on eggs
3746 batches
3755 pounds of butter
3763 containers of sour cream
3772 dozen eggs
3783 bags of powdered sugar
3793 bottles of vanilla
38011 batches
381check plural on granulated sugar
38214 batches
383check plural on flour
384How to Submit
385When ready to submit to the Autograder, visit https://eecs183.org/assignments.
386
387Click on Submit under Project 1.
388
389Click Choose file and navigate to your file. The file you submit to the autograder MUST be called cupcakes.cpp.
390
391If you’re using Xcode and don’t know how where exactly cupcakes.cpp is located on your disk, right-click (or click while holding down the Control key) on the file in the Navigator area on the left side of the Xcode window and choose Show in Finder.
392
393show in finder
394If you’re using Visual Studio and would like to know where cupcakes.cpp is on your disk, right-click on cupcakes.cpp in the tab above the Code pane and choose Open Containing Folder.
395
396open containing folder
397If confident that you’ve selected the correct file, click Submit to submit to the Autograder. The autograder will tell you if you did not select a file of the correct name. We strong urge you NOT to hit submit, but choose the correct file instead. If you hit “submitâ€, it will count as one of your two submits per day.
398
399You have 2 submits per day with feedback. We strongly suggest you use these submits. You will know within seconds how well your code performs and what your score is. You will know when you get a perfect score. Basically, USE YOUR 2 SUBMITS PER DAY WITH FEEDBACK.
400
401For the first two submissions on each day, you will receive an email with your score and feedback. In the feedback, the messages given for what is being tested are somewhat descriptive, but are cryptic. The messages are meant to be only a hint — NOT a detailed description concerning what is being tested. Real life does NOT come with an autograder. Therefore, you should test your program with your own full test suite.
402
403Differences in white space will NOT fail the autograder.
404For this project, you have one additional “wildcard†submission. But as always, you have an infinite number of blind submissions, so feel free to (re-)submit as much as you’d like. We will pull your last submit for “final gradingâ€.
405
406You will soon develop a “love/hate†relationship with the autograder. You will “love†that you can check your code to see your score. You will “love†that it gives you feedback. You will “hate†that it tells you that you are not totally correct on the first submit.
407
408Remember this is where we pull code from for final testing. We take the LAST submit to Project 1 for final testing. This is the ONLY place we will pull from.
409You have an infinite number of submits per day but feedback for only the first two per day. Additionally, once per project, you get feedback on a 3rd submit. All others are what we call “blind submitsâ€. These “blind submits†do not have feedback — not even a score. We urge to use them cautiously especially if they are your last submit — since that last submit is the one you will be graded on. You could get an unpleasant surprise if you are not really really careful.
410S’more
411If you would like more of a challenge, try this version. Here’s an excerpt from the Syllabus about S’mores:
412
413In order to accommodate students with different backgrounds and interests, most projects include a S’more part. Its purpose is to challenge those students who are more comfortable and would like to solve a more sophisticated problem. Students who submit S’mores do not receive any extra credit outright, but we do bear in mind these submissions when determining the grades at the semester’s end.
414You must first complete and submit to the Autograder the Regular version of the project.
415Submit S’more by Friday 9/23. If you submit the Regular project early (before Friday 9/23), you will still receive bonus points, as described in the Grading section.
416Objective
417For the S’more challenge, some ingredients are available in different sized containers. You must create your shopping list such that the total cost is minimized. You may mix the size of containers to allow for the minimization of cost. So you may buy a single 1 oz bottle of vanilla and a single 2 oz bottle to get what you need.
418
419You will also need to list the size of sour cream and of vanilla on your shopping list:
420
4212 8 oz containers of sour cream
4221 1 oz bottle of vanilla
4231 2 oz bottle of vanilla
424Ingredients
425For your shopping list, you may purchase all items listed earlier plus sour cream and vanilla in additional sizes. All ingredients are listed below along with the sizes and costs.
426
427Ingredient Cost Conversion
4285 lb bag of Flour
429$3.09
43020 cups in 5 lb
4315 lb bag of Granulated Sugar
432$2.98
43310 cups in 5 lb
4341 lb Butter
435$2.50
4362 cups in 1 lb
4378 oz of Sour Cream
438$1.29
4391 cup in 8 oz
4403 lb of Sour Cream
441$6.29
4426 cups in 3 lbs
443Dozen Eggs
444$2.68
44512 eggs in dozen
4462 lb Powdered Sugar
447$1.18
4485 ½ cups in 2 lb
4491 oz Vanilla
450$2.74
4516 teaspoons in 1 fluid oz
4522 oz Vanilla
453$4.12
45412 teaspoons in 2 fluid oz
4558 oz Vanilla
456$10.95
45748 teaspoons in 8 fluid oz
458Baking powder, Salt
459Infinite supply available for no $$$
460How to Submit
461When ready to submit to the Autograder, visit https://eecs183.org/assignments.
462
463Choose Submit (S’more) under Project 1.
464
465Click Choose file and navigate to your file. The file you submit to the autograder MUST be called cupcakes.cpp.
466
467If confident that you’ve selected the correct file, click Submit to submit to the Autograder.
468
469All the rules listed in How to Submit section above still apply.
470
471Make sure to first submit the Regular version for project. S’mores are for additional practice and not for the points. However, we do take correct S’mores into consideration when we determine final grades.
472
473Additional (yet important!) Information
474In this section, you will find specific information that will help you in implementing your project.
475
476Coding Warm-Up
477So that it’s easier (and more fun) for you to work on this project, be sure you’re able to answer these questions before you start implementing your project:
478
479What is pseudocode? How is it different from source code or C++?
480
481What’s a compiler? What is its purpose in life?
482
483What does
484
485int main() {
486 // ...
487}
488do?
489
490What types of variables exist in C++?
491
492Why does 3 / 2 evaluate to 1 and not to 1.5?
493
494How do you fix the above problem?
495
496When do you specify a type before a variable’s name? What’s the difference between
497
498double temperature = 350.5;
499and
500
501temperature = 350.5;
502What’s the difference between constants and variables? How would you define each?
503
504What’s the purpose of '\n', '\t', '\'', '\"' and '\\'?
505
506What’s a library?
507
508What role does #include <iostream> play when you write it atop some program?
509
510What’s a function?
511
512<cmath> library comes with many functions related to math, such as sqrt that returns the square root of the function’s argument (i.e. input). How can you use sqrt to find the square root of 36? 64? 183? How would you print the answers?
513
514Head over to EECS 183 Style Guide and read the sections on Comments, Whitespace and Indentation, and Variables and Constants.
515
516What are magic numbers? How and why do you avoid them?
517
518What are global variables? Why should you avoid them?
519
520Where to Begin
521The best approach is always to start small and build it up—one piece at a time. Never try and do the entire thing at once.
522
523First, start with writing out some logic on a piece of paper. What needs to happen first?
524
525Start with the inputs: what inputs are needed? What are the exact prompts that are needed? What variable(s) is/are needed? What do you want to call the variable(s)?
526
527Next figure out how many batches are needed. How do you do this? What data is needed? What computation is needed to determine how many batches?
528
529logic flow
530We suggest starting with pseudocode, remember Lecture 01. Pseudocode is a way to explain what needs to happen in English before having to figure out how to do it in code. It is a way to lay out what is needed logically without the overhead of C++ code.
531
532Only after writing out the pseudocode of what is described above is it time to then translate it to C++. This will save you hours when you start coding, trust us!
533
534General Tips
535Think about it. Plan it. Design it. Start on paper. The worst thing you can do is to start typing code. If you do, plan on it taking about 6 times longer than if you just thought about it first.
536
537Start by laying out the logic.
538
539Start with the inputs: what inputs are needed? What are the exact prompts that are needed? What do you want to call the variables?
540
541Next figure out how many batches are needed. How do you do this? What data is needed? What computation is needed to determine how many batches?
542
543Next the outputs: what outputs are needed? How do you print out how many batches are needed?
544
545Where do you print the Shopping List …​
546
547Figure out how much flour is needed. How do you do this conversion? What data is needed? Now how do you print this out in your shopping list?
548
549Now work on how much sugar you will need. How do you do this conversion? What data is needed? How do you print this out? And continue with the other ingredients and their conversions.
550
551Double check your logic. Are the conversions correct? Do you have the ordering correct?
552
553Once you have this laid out, now is the time to create that project and begin typing code.
554
555Style Checklist
556To maximize your style points, be sure to follow this non-exhaustive checklist:
557
558 Review EECS 183 Style Guide. Pay particular attention to Comments, Whitespace and Indentation and Variables and Constants.
559
560 Be sure you’ve included your name, your uniqname and a small description of the program in the header comments
561
562 Be sure to use descriptive variable names. The more descriptive the variable names, the less you need to comment
563
564 Be sure that your code is well-commented. It might at first seem that the algorithm is straight-forward and self-explanatory, but would you remember all the details a month from now? And it’s much easier for the staff to help you with your code if you have comments!
565
566 Remember to avoid magic numbers. Be sure that you don’t have numbers like 12, 10, 20, 5.5, or 8 in your code!
567
568 And certainly don’t use global variables. However, global constants are OK and should be used
569
570 Remember that all lines must be 80 characters or less.
571
572 Check out Project 1 Style Rubric to avoid any deductions.
573
574Sample Output
575These sample runs are available for an easy check. A quick way to check is to use a diff program or a website. diff is a utility that allows you to compare two files and outputs any differences therein. Use it to compare the sample runs against the output generated by your code using the same input. Some easy-to-use diff websites we recommend are:
576
577diffchecker.com
578
579quickdiff.com
580
581diffnow.com
582
583Here are a few examples of the way your program output should look, wherein underlined text represents some user’s input.
584
585Sample run 1
586How many people do you need to serve? 3
587
588
589You need to make: 1 batch of cupcakes
590
591Shopping List for "Best Ever" Vanilla Cupcakes
592----------------------------------------------
593 1 bag of flour
594 1 bag of granulated sugar
595 1 pound of butter
596 1 container of sour cream
597 1 dozen eggs
598 1 bag of powdered sugar
599 1 bottle of vanilla
600
601Total expected cost of ingredients: $17.84
602
603Have a great party!
604Sample run 2
605How many people do you need to serve? 12
606
607
608You need to make: 1 batch of cupcakes
609
610Shopping List for "Best Ever" Vanilla Cupcakes
611----------------------------------------------
612 1 bag of flour
613 1 bag of granulated sugar
614 1 pound of butter
615 1 container of sour cream
616 1 dozen eggs
617 1 bag of powdered sugar
618 1 bottle of vanilla
619
620Total expected cost of ingredients: $17.84
621
622Have a great party!
623Sample run 3
624How many people do you need to serve? 13
625
626
627You need to make: 2 batches of cupcakes
628
629Shopping List for "Best Ever" Vanilla Cupcakes
630----------------------------------------------
631 1 bag of flour
632 1 bag of granulated sugar
633 2 pounds of butter
634 1 container of sour cream
635 1 dozen eggs
636 1 bag of powdered sugar
637 1 bottle of vanilla
638
639Total expected cost of ingredients: $20.34
640
641Have a great party!
642Sample run 4
643How many people do you need to serve? 40
644
645
646You need to make: 4 batches of cupcakes
647
648Shopping List for "Best Ever" Vanilla Cupcakes
649----------------------------------------------
650 1 bag of flour
651 1 bag of granulated sugar
652 3 pounds of butter
653 2 containers of sour cream
654 1 dozen eggs
655 2 bags of powdered sugar
656 2 bottles of vanilla
657
658Total expected cost of ingredients: $29.43
659
660Have a great party!
661S’more Sample Output
662Here are a few examples of the way your S’more program output should look, wherein underlined text represents some user’s input.
663
664S’more Sample run 1
665How many people do you need to serve? 10
666
667
668You need to make: 1 batch of cupcakes
669
670Shopping List for "Best Ever" Vanilla Cupcakes
671----------------------------------------------
672 1 bag of flour
673 1 bag of granulated sugar
674 1 pound of butter
675 1 8 oz container of sour cream
676 1 dozen eggs
677 1 bag of powdered sugar
678 1 1 oz bottle of vanilla
679
680Total expected cost of ingredients: $16.46
681
682Have a great party!
683S’more Sample run 2
684How many people do you need to serve? 12
685
686
687You need to make: 1 batch of cupcakes
688
689Shopping List for "Best Ever" Vanilla Cupcakes
690----------------------------------------------
691 1 bag of flour
692 1 bag of granulated sugar
693 1 pound of butter
694 1 8 oz container of sour cream
695 1 dozen eggs
696 1 bag of powdered sugar
697 1 1 oz bottle of vanilla
698
699Total expected cost of ingredients: $16.46
700
701Have a great party!
702S’more Sample run 3
703How many people do you need to serve? 13
704
705
706You need to make: 2 batches of cupcakes
707
708Shopping List for "Best Ever" Vanilla Cupcakes
709----------------------------------------------
710 1 bag of flour
711 1 bag of granulated sugar
712 2 pounds of butter
713 1 8 oz container of sour cream
714 1 dozen eggs
715 1 bag of powdered sugar
716 1 2 oz bottle of vanilla
717
718Total expected cost of ingredients: $20.34
719
720Have a great party!
721S’more Sample run 4
722How many people do you need to serve? 40
723
724
725You need to make: 4 batches of cupcakes
726
727Shopping List for "Best Ever" Vanilla Cupcakes
728----------------------------------------------
729 1 bag of flour
730 1 bag of granulated sugar
731 3 pounds of butter
732 2 8 oz containers of sour cream
733 1 dozen eggs
734 2 bags of powdered sugar
735 1 1 oz bottle of vanilla
736 1 2 oz bottle of vanilla
737
738Total expected cost of ingredients: $28.05
739
740Have a great party!
741Last updated 2016-09-18 10:58:04 EDT