Introduction To Programming
10-152-310

Learning Plan 2 : Variables and Data Types

Source Code

			// DEMO CODE STARTS AFTER THIS LINE:
                // We put variables up here before anything else
                var name = "Fred";
                var count = 10;
                // Once all of our variables are declared we can start 
                // our logic code
                document.write("Hello, " + name + "!");
                /*
                     It's good to have lots of lines like this that 
                     explain our code. For example the next line of code 
                     puts an HTML line break tag on our page.
                */
                document.write("
"); document.write("Your count is " + count); // The next line of code is what we call "Commented out". // This means that we don't want it to run but we don't // want to delete it. //alert("Yo, " + name + "!"); // END OF YOUR CODE

Demo Output