Project 4 was based on Identity and our goal was to create a web page that will discuss about how identity is important. For example, I discussed what is identity, why identity is important, and how it's important. I also discussed about my identity and how it's affected by how I go on with my life. This project was relatively easy the only difficult part was trying to get the layout correct. It's actually easy once you get the one page done you could do the rest. I found my buttons at a source, w3schools.com. I copied the code of the HTML and CSS and changed it so it could match my site. I have learned many new things, such as having a layout that is visually appealing.
Monday, June 12, 2017
Friday, June 9, 2017
Lab 17: JS Conditional Statement
This lab was difficult to create as I found many difficulties to find how to function this lab. As we were supposed to create JS conditional statements; conditional statements are tags if, else, else if, or switch. As I created a button which had x=x+y, this button will add the two values. Then a pop up will appear asking if you if want to add these two values together. If you press confirm they will add these values if you press cancel. An error will occur, if you chose to add these values the value of the two inputs will be replace with the x value. This will then perform a loop if you keep on adding these values.
| <script> | |
| function AdditionBy() { | |
| var x = document.getElementById("a").value; | |
| var y = document.getElementById("b").value; | |
| var r = confirm("Would you like to replace the X value with the following answer?"); | |
| if (r == true) { | |
| txt = document.getElementById("demo").innerHTML = Number(x) + Number(y); | |
| document.getElementById("a").value = txt; | |
| } else { | |
| txt = document.getElementById("demo").innerHTML = Number(x) + Number(y); | |
| } | |
| document.getElementById("demo").innerHTML = txt; | |
| } | |
| </script> This is JavaScript Code That I Used |
Lab 16: Comparison Operators
This lab was fairly easy as I understood how to create a calculator that will function differently from my other labs. This lab had an input value x and an output value y. I had buttons that had functions, such as x==y, x>y, x<y, x>=y, and x<=y. These functions were greater than, less than, greater or equal, less or equal, and compare. Compare was a function to compare both values to see if they are equal. I used JavaScript in this lab which was needed to get these values to work. Probably the only difficult about this lab was to find the tags to make this work.
This code below was used to get the first button to work;
| //Comparison | |
| function comp() | |
| { | |
| var x = document.getElementById("firstNum").value; | |
| var y = document.getElementById("secondNum").value; | |
| document.getElementById("demo").innerHTML = (x==y); | |
| } To sum up this lab was fairly easy and I will use this knowledge for future labs and projects. |
Lab 15 Assignment Operators
This Lab was difficult as I had to make a calculator that would have an input and an output value. The task of this lab was to create a calculator that have an initial input value such as 10 and you will put in a value for the output. I put buttons that were x=y, x=x+y, x=x-y, x=x*y, and x=x/y. Each equation will have a different value. For example, x=y will switch the value of x to y. The other equations will add, subtract, multiply, and divide. But this will be a loop as the output value could be added, multiplied, and divided after it's been put in an equation. This lab was difficult at first but became much easier when I solved one button.
Subscribe to:
Comments (Atom)


