Skip to content

Commit 0438fc2

Browse files
committed
y
1 parent f6856ca commit 0438fc2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

loops/studio/solution.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ let desserts = ['apple', 'banana', 'more kale', 'ice cream', 'chocolate', 'kiwi'
3434

3535
function askForNumber() {
3636
numMeals = input.question("How many meals would you like to make?");
37+
while(numMeals >6 || numMeals<1 || isNaN(numMeals)){
38+
numMeals=input.question("enter a number between 1 and 6")
3739

40+
return numMeals
41+
}
3842
/// CODE YOUR SOLUTION TO PART B here ///
3943

4044
return numMeals;
@@ -56,16 +60,16 @@ function runProgram() {
5660
/// Change the final input variable (aka numMeals) here to ensure your solution makes the right number of meals ///
5761
/// We've started with the number 2 for now. Does your solution still work if you change this value? ///
5862

59-
let meals = mealAssembly(protein, grains, veggies, beverages, desserts, 2);
60-
console.log(meals)
63+
// let meals = mealAssembly(protein, grains, veggies, beverages, desserts, 2);
64+
// console.log(meals)
6165

6266

6367
/// TEST PART B HERE ///
6468
/// UNCOMMENT the next two lines to test your ``askForNumber`` solution ///
6569
/// Tip - don't test this part until you're happy with your solution to part A #2 ///
6670

67-
// let mealsForX = mealAssembly(protein, grains, veggies, beverages, desserts, askForNumber());
68-
// console.log(mealsForX);
71+
let mealsForX = mealAssembly(protein, grains, veggies, beverages, desserts, askForNumber());
72+
console.log(mealsForX);
6973

7074
/// TEST PART C HERE ///
7175
/// UNCOMMENT the remaining commented lines and change the password1 and password2 strings to ensure your code is doing its job ///

0 commit comments

Comments
 (0)