From 3468cd85fbf428ebca6ec12336635aebe9092d2b Mon Sep 17 00:00:00 2001 From: Levi McLean Date: Thu, 16 Oct 2025 21:16:45 -0400 Subject: [PATCH] Added midterm notes --- INFO-1272 (JS 1)/Notes/Midterm/index.html | 123 ++++++++++++++++++++++ INFO-1272 (JS 1)/Notes/Midterm/index.js | 30 ++++++ 2 files changed, 153 insertions(+) create mode 100644 INFO-1272 (JS 1)/Notes/Midterm/index.html create mode 100644 INFO-1272 (JS 1)/Notes/Midterm/index.js diff --git a/INFO-1272 (JS 1)/Notes/Midterm/index.html b/INFO-1272 (JS 1)/Notes/Midterm/index.html new file mode 100644 index 0000000..892d84e --- /dev/null +++ b/INFO-1272 (JS 1)/Notes/Midterm/index.html @@ -0,0 +1,123 @@ + + + + Midterm Study + + + + +

Midterm Study

+

Introduction to Web Pages

+
    +
  1. A web page is a container for the following three technologies. Describe the purpose of each for a web page:
  2. + +
+

Answers:

+ +
+ +

Introduction to javascript

+
    +
  1. Browser pop-up dialogue box functions
  2. + +
+

Answers:

+ +
+ +

Data Types and Variables

+
    +
  1. Name JavaScript's three data types. Describe the types of data they store
  2. +
  3. JavaScript is a weakly-typed language. Describe what this means.
  4. +
  5. What are the naming rules for a variables name? What are naming conventions?
  6. +
  7. What is a constant in JavaScript? Describe how you would declare a JavaScript constant.
  8. +
+

Answers:

+
    +
  1. Number, String and Boolean
  2. +
  3. weakly-typed language implies that data types do not need to be defined at initialization, the compiler will decide, cast and convert the data type unless explicitly cast
  4. +
  5. A naming convention is a recommended way of naming variables to ensure readability and organize code. JavaScript uses camelCase for variables and classes and UPPER_SNAKE_CASE for constants
  6. + + let customerAge = 23;
    + const ONT_TAX_RATE = 0.13; +
    +
  7. A constant is a variable whose value cannot be changed once initialized, making it constant. To define a constant, use the "const" keyword.
  8. +
+
+ +

Operators

+
    +
  1. Explain the following binary operators: + - * / %
  2. +
  3. Explain the multiple uses of the + operator.
  4. +
  5. Describe how the increment/decrement operators (++ and --) work.
  6. +
+

Answers:

+
    +
  1. The + operator is used to get the sum, the - operator is to get the difference, the * operator multiplies, the / operator divides and the % (modulus) operator determines if two numbers divided have a remainder and how much of one
  2. +
  3. The + operator can be used to add two numbers together to find their sum, or you can use it to concatenate multiple Strings together.
  4. +
  5. The ++ (increment) operator is used to increase the value of a variable by exactly one. The -- (decrement) operator is used to decrease the value of a variable by exactly 1.
  6. +
+
+ +

The JavaScript Math object

+
    +
  1. Describe the operation and the return for the following Math methods:
  2. + +
+

Answers:

+ +
+ +

JavaScript Number Methods

+
    +
  1. Describe the operation and the return for the following Number methods:
  2. + +
+

Answers:

+ + + + + \ No newline at end of file diff --git a/INFO-1272 (JS 1)/Notes/Midterm/index.js b/INFO-1272 (JS 1)/Notes/Midterm/index.js new file mode 100644 index 0000000..e454c94 --- /dev/null +++ b/INFO-1272 (JS 1)/Notes/Midterm/index.js @@ -0,0 +1,30 @@ +// Window dialogue boxes +window.alert("This is an alert!"); +window.prompt("This is a prompt"); +window.confirm("This is a confirm"); + +// Data types +let userAge = Number("22"); +let userName = String("Levi"); +let isAdmin = Boolean(1); +console.log("User age: " + userAge); +console.log("User name: " + userName); +console.log("Is admin? " + isAdmin); + +// Weakly-typed variables + +// Constants + +// Operators + +// Math object methods + +// Number object methods + +// String object methods + +// Selection structure + +// Functions + +// Repitition structure \ No newline at end of file