Grahpic Design Project 1
@@ -1,15 +1,17 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<title>Midterm Study</title>
|
<title>Midterm Study</title>
|
||||||
<meta charset="utf-8" lang="en-us">
|
<meta charset="utf-8" lang="en-us">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Midterm Study</h1>
|
<h1>Midterm Study</h1>
|
||||||
<h2>Introduction to Web Pages</h2>
|
<h2>Introduction to Web Pages</h2>
|
||||||
<ol>
|
<ol>
|
||||||
<li>A web page is a container for the following three technologies. Describe the purpose of each for a web page:</li>
|
<li>A web page is a container for the following three technologies. Describe the purpose of each for a web page:
|
||||||
|
</li>
|
||||||
<ul>
|
<ul>
|
||||||
<li>HTML</li>
|
<li>HTML</li>
|
||||||
<li>CSS</li>
|
<li>CSS</li>
|
||||||
@@ -49,13 +51,16 @@
|
|||||||
<p>Answers:</p>
|
<p>Answers:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Number, String and Boolean</li>
|
<li>Number, String and Boolean</li>
|
||||||
<li>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</li>
|
<li>weakly-typed language implies that data types do not need to be defined at initialization, the compiler will
|
||||||
<li>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</li>
|
decide, cast and convert the data type unless explicitly cast</li>
|
||||||
|
<li>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</li>
|
||||||
<code>
|
<code>
|
||||||
let customerAge = 23;<br>
|
let customerAge = 23;<br>
|
||||||
const ONT_TAX_RATE = 0.13;
|
const ONT_TAX_RATE = 0.13;
|
||||||
</code>
|
</code>
|
||||||
<li>A constant is a variable whose value cannot be changed once initialized, making it constant. To define a constant, use the "const" keyword.</li>
|
<li>A constant is a variable whose value cannot be changed once initialized, making it constant. To define a
|
||||||
|
constant, use the "const" keyword.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
@@ -67,9 +72,13 @@
|
|||||||
</ol>
|
</ol>
|
||||||
<p>Answers:</p>
|
<p>Answers:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>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</li>
|
<li>The + operator is used to get the sum, the - operator is to get the difference, the * operator multiplies,
|
||||||
<li>The + operator can be used to add two numbers together to find their sum, or you can use it to concatenate multiple Strings together.</li>
|
the / operator divides and the % (modulus) operator determines if two numbers divided have a remainder and
|
||||||
<li>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.</li>
|
how much of one</li>
|
||||||
|
<li>The + operator can be used to add two numbers together to find their sum, or you can use it to concatenate
|
||||||
|
multiple Strings together.</li>
|
||||||
|
<li>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.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
@@ -94,11 +103,14 @@
|
|||||||
<li>Math.PI is a constant value for PI</li>
|
<li>Math.PI is a constant value for PI</li>
|
||||||
<li>Math.abs(x) returns the absolute value of X (makes a negative positive)</li>
|
<li>Math.abs(x) returns the absolute value of X (makes a negative positive)</li>
|
||||||
<li>Math.pow(x,2) returns the value of x to the power of y (in this case 2)</li>
|
<li>Math.pow(x,2) returns the value of x to the power of y (in this case 2)</li>
|
||||||
<li>Math.round(x) returns x rounded to the nearest whole. Below 0.5 is rounded down, above 0.5 is rouded up.</li>
|
<li>Math.round(x) returns x rounded to the nearest whole. Below 0.5 is rounded down, above 0.5 is rouded up.
|
||||||
|
</li>
|
||||||
<li>Math.ceil(x) returns the "ceiling" of x, which is the next highest whole integer.</li>
|
<li>Math.ceil(x) returns the "ceiling" of x, which is the next highest whole integer.</li>
|
||||||
<li>Math.floor(x) returns the "floor" of x, which is the next lowest whole integer.</li>
|
<li>Math.floor(x) returns the "floor" of x, which is the next lowest whole integer.</li>
|
||||||
<li>Math.trunc(x) returns x truncated, which means it cuts off the decimal places regardless of what they are.</li>
|
<li>Math.trunc(x) returns x truncated, which means it cuts off the decimal places regardless of what they are.
|
||||||
<li>Math.random() returns a random number between 0 and 1, can be manipulated to return in between any range</li>
|
</li>
|
||||||
|
<li>Math.random() returns a random number between 0 and 1, can be manipulated to return in between any range
|
||||||
|
</li>
|
||||||
<li>Math.min(x,y) returns the minimum of two numbers. The smaller of the two</li>
|
<li>Math.min(x,y) returns the minimum of two numbers. The smaller of the two</li>
|
||||||
<li>Math.max(x,y) returns the maximum of two numbers. The larger of the two</li>
|
<li>Math.max(x,y) returns the maximum of two numbers. The larger of the two</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -115,9 +127,15 @@
|
|||||||
<p>Answers:</p>
|
<p>Answers:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>toFixed() returns x but at a fixed number of decimal places, defined by y</li>
|
<li>toFixed() returns x but at a fixed number of decimal places, defined by y</li>
|
||||||
<li>toPrecision() returns x but at a fixed number of significant digits. This means it may round deicimal places before dropping them.</li>
|
<li>toPrecision() returns x but at a fixed number of significant digits. This means it may round deicimal places
|
||||||
|
before dropping them.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Playground</h2>
|
||||||
|
<p>Interactive JavaScript follows</p>
|
||||||
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
// 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
|
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 689 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 727 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/bubble-tea-1.jpg
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/bubble-tea-2.jpg
Normal file
|
After Width: | Height: | Size: 791 KiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/bubble-tea-3.jpg
Normal file
|
After Width: | Height: | Size: 9.5 MiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/planet 3.jpg
Normal file
|
After Width: | Height: | Size: 821 KiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/planet-1.jpg
Normal file
|
After Width: | Height: | Size: 476 KiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/planet-2.jpg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/planet-4.jpg
Normal file
|
After Width: | Height: | Size: 428 KiB |
BIN
INFO-1274 (Graphic Design)/Projects/Project 1/planet-5.jpg
Normal file
|
After Width: | Height: | Size: 268 KiB |