You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: Create 1-Boolean variable to demonstrate a true or false scenario.
21
+
// YOUR CODE GOES HERE
22
+
varhungryForGummySharks=true;
23
+
if(hungryForGummySharks===true)
24
+
{
25
+
varhungryForGummySharks="Shrek is very hungry"
26
+
}
27
+
28
+
// TODO: Print your story to the console.
29
+
// YOUR CODE GOES HERE
30
+
console.log(protagonistName+" loves nothing more than to snack on gummy sharks as he plays his banjo.");
31
+
console.log("They have been his favorite candy for the past "+protagonistAge+" years of his life.");
32
+
console.log("But, oh no! He ran out.")
33
+
console.log("Because it is the "+century+", "+protagonistName+" can not order more scrumptious gummy sharks from amazon, so he walks to "+storySetting+".");
34
+
console.log("As he arrives, he enters the doorway with "+possesions+", and a goal in his heart: "+protagonistObjective+".");
35
+
console.log("He begins his "+storyTitle+" in isle "+year+".");
36
+
console.log(hungryForGummySharks+", so as soon as he lays his eyes on the gummy section, he snatches every single container on the shelf, pays, and bolts back home.")
37
+
console.log("Thus, he was finally able to spend the rest of his day happily snacking on gummy sharks and playing his banjo...")
/************************************************ DONT CHANGE THE CODE BELOW ******************************************************/
28
+
functionalert3(){
29
+
alert("All students need to get their student IDs, but it seems like the system is down. Can you help debug the system? Go to the example2.js file and work on checkpoint 2.");
30
+
}
31
+
32
+
functionalerts(studentID){
33
+
if(studentID.length==5){
34
+
alert("Yay! You got the system running!");
35
+
}
36
+
else{
37
+
alert("Hmmm! It seems like Rei hasn't received his ID. Keep debugging!");
* Description: This program is calculating the amount of change given to the customer after buying groceries but there is a bug
3
+
* in the code preventing the code to run as expected. Your task is to run and debug the program using the console to print
4
+
* statements.
5
+
*
6
+
* TODO: The program currently displays NaN in the console as the returned change. You should check and make sure the function
7
+
* is reading the passed parameters.
8
+
*/
9
+
10
+
functioncheckPoint3(){
11
+
alert4();
12
+
13
+
// TODO: Remove the bugs from the code below.
14
+
functionsuperMarket(cash){
15
+
letmilk=4.99;
16
+
letvegetables=15.99;
17
+
letbread=2.99;
18
+
19
+
lettotal=milk+vegetables+bread;
20
+
cash=totalCash-total;
21
+
22
+
returncash;
23
+
}
24
+
25
+
functionmain(cash){
26
+
letmoneySpent=superMarket();
27
+
returnmoneySpent;
28
+
}
29
+
30
+
lettotalCash=50.00;
31
+
console.log("Total Cash: $"+totalCash);
32
+
console.log("Change Return = $"+main(totalCash));
33
+
34
+
35
+
// DO NOT CHANGE THE CODE BELOW
36
+
if(main(totalCash)<50){
37
+
alert("Awesome work! You got the system running!");
38
+
}
39
+
}
40
+
41
+
42
+
/************************************************ DONT CHANGE THE CODE BELOW ******************************************************/
43
+
functionalert4(){
44
+
alert("The system at the supermarket doesn't seem to be working. Can you help debug the system to help calculate the total change return to the customer? Go to the example3.js file and work on checkpoint 3.");
// TODO: Add a Javascript setInterval() method that will call the Run() function above every 200 milliseconds. Note: in the video, Dr. Williams uses the setTimeout() method, but here we are going to use a slightly different
35
+
// method called setInterval(), so that you can have practice using this method.
36
+
// Inside of the Run() function you will also have to add an extra argument "pageWidth", which is declared on line 4 when you call the checkPageBounds() function below.
37
+
setInterval(Run,200);
38
+
39
+
// This function determines the direction of PacMan based on screen edge detection.
0 commit comments