Skip to content

Instantly share code, notes, and snippets.

@vidalinda1
Last active January 10, 2018 04:19
Show Gist options
  • Save vidalinda1/5989578cc0372aef1bdb4423c20cdd7f to your computer and use it in GitHub Desktop.
Save vidalinda1/5989578cc0372aef1bdb4423c20cdd7f to your computer and use it in GitHub Desktop.
Turing Prework

1st day


#On a website, what is the purpose of HTML code? HTML's purppose is to describe the structure of the page by using elements
#What is the difference between an element and a tag? the element contains tags as well as the information or description in between the tags
#Why do we use attributes in HTML elements? Attributes tell us more about elements, they provide addional information about the contents of an element.
#Describe the purpose of the head, title, and body HTML elements. * Head = The head element contains information about the page and it usually contains the title element. * Title = Usually located in the head element, the title displays in the top of the browser or on the tab of the page. * Body = all the content that's displayed on the main browser window
#In your browser (Chrome), how do you view the source of a website? right click and select view source.
#List five different HTML elements and what they are used for. For example,

is a paragraph element, and it is used to represent a paragraph of text.

H1

is a heading elements and it is used to represent a heading.
I element characters appear italic
br /add a line break inside the middle of a pharagraph
strong indicates that the content has strong importance.
q indicat shorter quotes that sit within a pharagraph.

#What are empty elements? they don't have any words between an opening and closing tag. They are written differently like line breaks and horizontal rules
#What is semantic markup? semantic markup provide extra information such as the meaning of acronyms
#What are three new semantic elements introduced in HTML 5? Use page 431 in the book to find more about these new elements. Header Article Aside

#CodePen https://codepen.io/sospinar21/pen/VybXWq

#why are we talking about empathy at a software development school? Turing mission's is to unlock human potential by training a diverse, inclusive student body to succeed in high fulfillment technical careers
#how can you develop the "skill" of empathy? work on self-awareness
#and why should you care? empathy is a very important skill that not only affects our personal lifes but also has a significant impact on our professional success
#What role does empathy play in your life and how has it helped you? Empathy is very important for me, specially because I personally was born in a 3rd world country and I've seen and lived lots of difficult situations. It's always very important for me to help people and be compassionate.
#How does empathy help you build better software? It will help me build a better software because I'll be able to work with my team in a respectful and peaceful way and helping each other.
#Why is empathy important for working on a team? because empathy enables people to communicate better with each other and to function more effectively.
#Describe a situation in which your ability to empathize with a colleague or teammate was helpful. Every day at work, I identify when people aren't happy or having a good day, instead of adding more preassure I try to empathize and help them feel better.
#When do you find it most difficult to be empathetic in professional settings? How can you improve your skills when faced with these scenarios? I think when I'm stressed or angry.

DAY 2

#There are three main types of lists in HTML: ordered, unordered, and definition. What are their differences? ordered list uses numbers, unordered bullets and definition lists are used to define terminology.
#What is the basic structure of an element used to link to another website?
#What attribute should you include in a link to open a new tab when the link is clicked? target = "_ blank" How do you link to a specific part of the same page?


#What is the purpose of CSS? Css allows you to create rules that specify how the content of an element should appear.
#What does CSS stand for? What does cascading mean in this case? cascading style sheet, If you include two stylesheets and there's a rule with the same specificity in each, the one included last wins.
#What is the basic structure of a CSS rule? selector {declaration;} the declaration contains a property and a value.
#How do you link a CSS stylesheet to your HTML document? In the head:
#What is it useful to use external stylesheets as opposed to using interal CSS? easier to access and to keep the style information organized
#Describe what a color hex code is. they're six digits codes that represent the amount of red, green and blue in a color, preceded by a pound or hash sign
#What are the three parts of an HSL color property? HUE, Sturation and Lightness.
#In the world of typeface, what are the three main categories of fonts? What are the differences between them? Serif ( has extra details "serifs" on the ends of the main strokes of the letters) Sans serif (straight ends to letters) and monospace ( same width)
#When specifiying font-size, what are the main three units used? Pixels, percentages and EMS.

Day 3

#If you're using an input element in a form, what attribute controls the behavior of that input?
#What element is used to create a dropdown list? select and option
#If you're using an input element to send form data to a server, what should the type attribute be set to?
#What element is used to group similar form items together? fieldset and legend
#Describe the differences between border, margin, and padding: The border separates the edge of one box from another. Margin sits outside the edge of the border and padding is the space between the border and any content inside the box.

#For a CSS rule padding: 1px 2px 5px 10px, what sides of the content box does each pixel value correspond to? 1. top - clockwise order
#Describe the different between block-level and inline elements. An inline element doesn't cause a line break, a block element always starts on a new line and takes up the full width.
#What is the role of fixed positioning, and why is z-index important in the scenario of using fixed positioning?Elements with fixed positioning do not affect the position of surrounding elements and they don't move when the user scrolls down or up. Z - index allows you to control which box appears on top.
#What is the difference between a fixed and liquid layout? Fixed width layouts do not change size as the user increases or decreases the size of the browser window, Liquid layouts stretch and contract.

Day 4

#In an image element, why is the alt attribute important? This provides a text description of the image if the image isn't displayed
#What determines if an image element is inline or block? where you place it in the code
#What are the benefits of jpg or png image file formats?jpg is better for images with lots of color, png is better for images with 1 solid color or few colors
#What is the benefit of specifying the height and width of images in CSS compared to specifying in the HTML? you can re use the attributes
#What is an image sprite, and why is it useful? is a collection of images put into a single, using them reduces the number of server requests

Day 5


#There are three big data types in JavaScript: numbers, strings, and booleans. Describe what each of them are. Numbers: The numeric value of the object being createt Strings: text, always in quotes booleans: condition - true or false
#What are the three logical operators that JavaScript supports? and, or, not
#What is the naming convention used for variables? var - name of the variable - "=" & expression
#What is the difference between an expression and a statement? An expression produces a value. An statement performs an action
#What are a few JavaScript reserved words, and why are they important to avoid using them for variable names? abstract, else, instanceof class, float, null. They have a specific meaning to the js language
#What is control flow, and why is it useful for programming? statements are executed from top to bottom, it's useful because we know which statement will run last.

DAY 6!


#If we have a function defined as function sayHello(){console.log("Hello!")}, what is the difference between entering sayHello and sayHello() in the console? sayHello() will return what we specified in the function in console.log while sayHello will show the whole function structure
#What is the keyword return used for? it determines the value the function returns.
#What are function parameters? They behave like regular variables, but their initial values are given by the caller of the function, not the code in the function itself
#What is the naming convention used for function names? function name() {}

JS Exercises

var allegro = "#";

for ( i = 0; i <=7; i++) { allegro = allegro + "#"; console.log(allegro) }

for (i = 0; i <= 100; i++){ if (!(i%3) && (!(i%3))) console.log("FizzBuzz");

else if (!(i%3)) {
console.log("Fizz");

} else if((i%3) && !(i%5)){ console.log("Buzz"); } else { console.log(i)} }


var size = 8; var aster = "#"; var espacio = " ";

for (i = 1; i <= size; i++){ var resultado = " ";

for (otro= 1; otro <= size; otro++){ if (i%2){ if (otro%2){ resultado = aster + resultado; } else { resultado = espacio + resultado; } } else { if (otro%2){ resultado = aster + resultado; } else { resultado = espacio + resultado; } } console.log(resultado) } }


var size = 8; var flag = 0; var resultado = ''; for (i = 1; i <= size; i++){ if(flag==0){ resultado += ' # # # #' + '\r'; flag = 1; } else{ resultado += '# # # # ' + '\r'; flag = 0; } } console.log(resultado);


function greet ( who ) { console . log (" Hello " + who ) ; } greet (" Harry ") ; console . log (" Bye ") ;

function printFarmInventory ( cows , chickens ) { var cowString = String ( cows ) ; while ( cowString . length < 3) cowString = "0" + cowString ; console . log (

cowString + " Cows ") ; var chickenString = String ( chickens ) ; while ( chickenString . length < 3) chickenString = "0" + chickenString ; console . log ( chickenString + " Chickens ") ; } printFarmInventory (7 , 11) ;

function min(numero1,numero2){ minimo = (numero1,numero2) Math.min return Math.min; }

console.log (min(1,5))


function isEven(n) { if (n == 0) return true; else if (n == 1) return false; else if (n < 0) return isEven(-n); else return isEven(n - 2); }
function countChar(string, ch) { var counted = 0; for (var i = 0; i < string.length; i++) if (string.charAt(i) == ch) counted += 1; return counted; }
function countBs(string) { return countChar(string, "B"); }

console.log(countBS("banana",));


function sayHello(){ console.log("Hello!") }
function tellFortune(number,name,location,title ){

var frase = "You will be a " + title + " in " + location + ", and married to " + name + " with " + number + " kids "; console.log(frase); } tellFortune(5,"Kai","NYC","developer"); tellFortune(2,"Ken","Denver","dancer"); tellFortune(0,"Dan","Washington","president");


function calculateAge(year,cyear){ var d = new Date(); var cyear = d.getFullYear(); var real =((cyear - year) - 1); var otro = (cyear - year ); var final = "You are either " + real + " or " + otro; console.log(final) } calculateAge(1990,); calculateAge(1991,); calculateAge(1994,);
function calculateSupply(age,amount){ var maxedad = 40; var totaldias = maxedad * 365; var edaddias = age * 365; var total = (totaldias - edaddias) * amount; var resultado = "You will need " + total + " to last you until the ripe old age of " + maxedad + " with no teeth"; console.log(resultado) } calculateSupply(26,2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment