@@ -12,7 +12,7 @@ let desserts = ['apple', 'banana', 'more kale', 'ice cream', 'chocolate', 'kiwi'
12
12
function mealAssembly ( protein , grains , veggies , beverages , desserts , numMeals ) {
13
13
let pantry = [ protein , grains , veggies , beverages , desserts ] ;
14
14
let meals = [ ] ;
15
-
15
+
16
16
/// Part A #2: Write a ``for`` loop inside this function
17
17
/// Code your solution for part A #2 below this comment (and above the return statement) ... ///
18
18
for ( i = 0 ; i < numMeals ; i ++ ) {
@@ -28,9 +28,15 @@ function mealAssembly(protein, grains, veggies, beverages, desserts, numMeals) {
28
28
29
29
function askForNumber ( ) {
30
30
let numPass = false
31
+ << < << << HEAD
31
32
32
33
/// CODE YOUR SOLUTION TO PART B here ///
33
34
35
+ === = ===
36
+
37
+ /// CODE YOUR SOLUTION TO PART B here ///
38
+
39
+ >>> > >>> 29 c570d60b0687daa5a55cc58af50bc5ba52461d
34
40
while ( ! numPass ) {
35
41
numMeals = input . question ( "How many meals would you like to make?" ) ;
36
42
if ( numMeals > 6 || numMeals < 1 || isNan ( numMeals ) ) {
@@ -54,20 +60,31 @@ function generatePassword(string1, string2) {
54
60
}
55
61
56
62
function runProgram ( ) {
57
-
63
+
58
64
/// TEST PART A #2 HERE ///
59
65
/// UNCOMMENT the two lines of code below that invoke the mealAssembly function (starting with 'let meals =') and print the result ///
60
66
/// Change the final input variable (aka numMeals) here to ensure your solution makes the right number of meals ///
61
67
/// We've started with the number 2 for now. Does your solution still work if you change this value? ///
68
+ < << << << HEAD
62
69
63
70
let meals = mealAssembly ( protein , grains , veggies , beverages , desserts , 2 ) ;
64
71
console . log ( meals )
65
72
73
+ === = ===
74
+
75
+ let meals = mealAssembly ( protein , grains , veggies , beverages , desserts , 2 ) ;
76
+ console . log ( meals )
77
+
78
+ >>> > >>> 29 c570d60b0687daa5a55cc58af50bc5ba52461d
66
79
}
67
80
/// TEST PART B HERE ///
68
81
/// UNCOMMENT the next two lines to test your ``askForNumber`` solution ///
69
82
/// Tip - don't test this part until you're happy with your solution to part A #2 ///
83
+ << < << << HEAD
70
84
85
+ === = ===
86
+
87
+ >>> > >>> 29 c570d60b0687daa5a55cc58af50bc5ba52461d
71
88
let mealsForX = mealAssembly ( protein , grains , veggies , beverages , desserts , askForNumber ( ) ) ;
72
89
console . log ( mealsForX ) ;
73
90
0 commit comments