Introduction To Programming
10-152-310

Learning Plan 3 : Math and Operators

Student

  • Name:
  • Section:
  • Email:

Part 1

  1. Open this file in your browser and Microsoft Visual Studio.
  2. Add your name, section, and email.
  3. Find the following code and remove either "true" or "false" from each line depending on what the expression will return. Don't code these, just think and remove the correct true/false.

Part 2

  1. Add code after the line: // PART 2: YOUR CODE STARTS AFTER THIS LINE: to complete this lab.
  2. Your output should look like the Example Output below.
  3. Variable declarations section
    1. Write a comment that identifies this coding section.
    2. Add the following variables:
      1. results1
      2. results2
      3. results3
      4. results4
      5. results5
      6. results6
      7. results7
      8. results8
  4. Assignments section - No assignments section this time! They will get values in the calculations section.
  5. Calculations section
    1. Write a comment that identifies this coding section.
    2. Assign true or false to each variable with the following boolean expressions. Alter each of the expressions by replacing the ??? with a relational operator. The variables must be assigned what is after each item.
      1. (5 ??? 5) --> true
      2. (5 ??? 5) --> false
      3. ("a" ??? "b") --> true
      4. (100 ??? 99) --> false
      5. ("100" ??? 100) --> true
      6. (0 ??? 10) --> false
      7. ("100" ??? "99") --> true
      8. ("A" ??? 92) --> false
  6. Output section
    1. Write a comment that identifies this coding section.
    2. Output each expression with a document.write();

Here's an example:

Boolean Expression: (7 ??? 5) --> true

             " + resultsExample);   
            ]]-->
        

Part 2 Example Output

        (7 > 5) --> true

Your Output for Part 2