diff --git a/Adam/calculator.html b/Adam/calculator.html new file mode 100644 index 0000000..7e6a719 --- /dev/null +++ b/Adam/calculator.html @@ -0,0 +1,40 @@ + + + + + Adam's Calculator + + + + + +
+ +
+
0
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ + + + \ No newline at end of file diff --git a/Adam/scripts/adam-script.js b/Adam/scripts/adam-script.js new file mode 100644 index 0000000..55f973e --- /dev/null +++ b/Adam/scripts/adam-script.js @@ -0,0 +1,82 @@ +function add (num1, num2) { + var z = num1 + num2; + return z; +} + +function subtract (num1, num2) { + var z = num1 - num2; + return z; +} + +function multiply (num1, num2) { + var z = num1 * num2; + return z; +} + +function divide (num1, num2) { + var z = num1 / num2; + return z; +} + +console.log(add(1, 2)); +console.log(subtract(2,1)); +console.log(multiply(2,2)); +console.log(divide(4,2)); + +var x = 100; +var y = 150; + +var sum = add(x,y); +var dif = subtract(y,x); +var prod = multiply(x,y); +var quo = divide(y,x); + +if (sum == 250) { + console.log("Correct. Sum is 250"); +} else { + console.log("Sum function is not working."); +} + +if (dif == 50) { + console.log("Correct. Difference is 50."); +} else { + console.log("Difference function is not working."); +} + +if (prod == 15000) { + console.log("Correct. Product is 15,000."); +} else { + console.log("Product function is not working."); +} + +if (quo == 1.5) { + console.log("Correct. Quotient is 1.5."); +} else { + console.log("Quotient function is not working."); +} + + +var x = Math.random(); +var y = Math.random(); + +var sum = add(x,y); +var dif = subtract(y,x); +var prod = multiply(x,y); +var quo = divide(y,x); + +if (sum > dif) { + console.log("Sum is greater then Dif"); +} else if (sum < dif) { + console.log("Sum is less than Dif"); +} else { + console.log("Sum is equal to Dif"); +} + +if (prod > quo) { + console.log("Product is greater then Quotient"); +} else if (prod < quo) { + console.log("Product is less than Quotient"); +} else { + console.log("Product is equal to Quotient"); +} + diff --git a/Adam/scripts/scripts.js b/Adam/scripts/scripts.js new file mode 100644 index 0000000..c7b93d9 --- /dev/null +++ b/Adam/scripts/scripts.js @@ -0,0 +1,15 @@ +function add (num1, num2) { + return num1 + num2; +} + +function subract (num1, num2) { + return num1 - num2; +} + +function multiply (num1, num2) { + return num1 * num2; +} + +function divide (num1, num2) { + return num1 / num2; +} \ No newline at end of file diff --git a/Adam/styles/styles.css b/Adam/styles/styles.css new file mode 100644 index 0000000..de02d43 --- /dev/null +++ b/Adam/styles/styles.css @@ -0,0 +1,76 @@ +html { + height: 100%; +} + +body { + height: 100%; + font-size: 45px; + background-color: #93d6d9; +} + +.container { + height:100%; + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +#calculator { + height: 70%; + width: 35%; + box-sizing: border-box; + border-radius: 15px; +} + +#result { + height: 25%; + width: 100%; + font-size: 155px; + text-align: right; + box-sizing: border-box; + background-color: #252525; + color: white; + border-top-left-radius: 15px; + border-top-right-radius: 15px; +} + +#buttons { + height: 75%; + display: flex; + flex-direction: column; + flex-wrap: wrap; + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; +} + +.button { + width: 25%; + height: 20%; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + border: 1px solid#b1b0b1; + background-color: #ffffff; +} + +.toprow { + background-color: #e9e9e9; +} + +#equals { + width: 25%; + height: 80%; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + background-color: #ea8666; + border: 1px solid #b1b0b1; + border-bottom-right-radius: 15px; +} + +#zero { + border-bottom-left-radius: 15px; +} \ No newline at end of file