Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book

Workshop

The quiz questions are provided for your further understanding.

Quiz

  1. What is the difference between data and information?
  2. What is a program?
  3. What is a programming language?
  4. True or false: Computers never make mistakes.
  5. Why should people not fear the computer replacing their jobs?
  6. What do programmers use editors for?
  7. True or false: Java and JavaScript are related to each other.
  8. What filename extension should you use when you create a JavaScript program?
  9. True or False: There’s no problem writing your programs in your typical word-processing program.
  10. Tweak the program in Listing 1.2 so the dialog box asks, “Who wrote this program?” and the answer the user gets upon clicking the button is your name.

Answers

  1. Data consists of raw facts and figures, and information is processed data that has more meaning.
  2. A program is a set of detailed instructions that tells the computer what to do.
  3. A programming language is a set of commands and grammar rules with which you write programs that give computers instructions.
  4. False. A computer might make a mistake, but it’s rare that it does so. In the vast majority of cases where a computer is blamed, a person entered bad data or typed a bad program.
  5. Computers increase jobs, not replace them. The information industry is one of the reasons for the past two decades of economic growth.
  6. Programmers use editors to type programs into the computer.
  7. False. JavaScript and Java only share a name; JavaScript was a scripting language that was developed at the same time Java was hot, so it was named in a way to take advantage of Java’s popularity.
  8. If your code is going to stay in your HTML document, you can use .html or .htm, but when you create separate JavaScript files, use .js.
  9. False. The default method of saving files in word processors will add formatting codes that will generate errors when you try to run your program. You can still use a word processor, but you must always remember to save your files as plain text.
  10. Here is one possible solution:

    <!DOCTYPE html>
    <html>
    <head>
    <script>
    
    /* This is the function that gets
    called when the user clicks the
    button on the main page */
    
    function displayProgrammer()
    {
    document.write("Dean Miller did!");
    }
    </script>
    </head>
    <body>
    
    
    <h1>My First Program</h1>
    <p id="demo">Who wrote this program?.</p>
    
    <button type="button" onclick="displayProgrammer()">And the answer is...</
    button>
    
    </body>
    </html>
  • + Share This
  • 🔖 Save To Your Account