Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions applepierecipe.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
body {
font-family: sans-serif;
color: #47494c;
font-weight: lighter;
}

.backgroundimage {
position: relative;
background-position: bottom;
text-align: center;
height: 700px;
overflow: hidden;
}

h1 {
text-align: center;
position: absolute;
margin: auto;
top: 50%;
left:0;
right:0;
bottom:0;
color: white;
font-family: sans-serif;
font-size: 80px;
font-weight: lighter;
}

.intro {
font-family: sans-serif;
color: #47494c;
font-weight: lighter;
text-align: center;
padding: 40px 100px 40px 100px;
margin: 40px 100px 40px 100px;
font-size: 25px;
line-height: 1.25em;
}
.foodprep {
text-align: center;
position: relative;
}

hr { width:70%; height:1px; background: #fff }

#ingredients {
padding: 20px 100px;
margin: 20px 100px;
font-size: 20px;
line-height: 1.5em;
}

ul {
list-style-type: none;
}

ul li:before {
content: '\2014';
position: absolute;
margin-left: -20px;
}

.method {
padding: 20px 100px;
margin: 20px 100px;
font-size: 20px;
line-height: 1.5em;
}

h3 {
font-weight: lighter;
}
71 changes: 71 additions & 0 deletions applepierecipe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Apple Pie Recipe</title>
<link rel="stylesheet" href="applepierecipe.css">
</head>
<body>

<div class="backgroundimage">

<img src="./images/apple-pie.jpg" width="95%" alt="Apple pie ingredients"/>

<h1>Apple Pie</h1>

</div>

<p class="intro">This was my grandmother's apple pie recipe. I have never seen another one
quite like it. It will always be my favorite and has won me several first place
prizes in local competitions. I hope it becomes one of your favorites as well!</p>

<div class="foodprep">

<img src="./images/recipe-info.png" width="30%" alt="1 hour and 30 minute preparation time. 8 servings. 512 calories."/>

</div>

<hr/>

<div id="ingredients">
Ingredients

<ul>
<li>1 recipe pastry for a 9 inch double crust pie</li>
<li>1/2 cup unsalted butter</li>
<li>3 tablespoons all-purpose flour</li>
<li>1/4 cup water</li>
<li>3 tablespoons all-purpose flour</li>
<li>1/4 cup water</li>
<li>1/2 cup white sugar</li>
<li>1/2 cup packed brown sugar</li>
<li>8 Granny Smith apples - peeled, cored and sliced</li>
</ul>

</div>

<div class="foodprep">

<img src="./images/cooking-info.png" width="30%" alt="Preparation time, 30 minutes. Cook, 1 hour. Ready in 1 hour and 30 minutes"/>

</div>

<hr/>

<div class="method">
<h3> Directions </h3>
<p>
1) Preheat oven to 425 degrees F (220 degrees C). Melt the butter in a saucepan. Stir in
flour to form a paste. Add water, white sugar and brown sugar, and bring to a boil. Reduce
temperature and let simmer.
<br>
2) Place the bottom crust in your pan. Fill with apples, mounded slightly. Cover with a
lattice work crust. Gently pour the sugar and butter liquid over the crust. Pour slowly so
that it does not run off.
<br>
3) Bake 15 minutes in the preheated oven. Reduce the temperature to 350 degrees F (175
degrees C). Continue baking for 35 to 45 minutes, until apples are soft.
</p>
</div>

</body>
</html>
72 changes: 72 additions & 0 deletions images/Apple Pie Recipe.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<!-- saved from url=(0074)file:///Users/Michelle/lab-javascript-basic-algorithms/applepierecipe.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Apple Pie Recipe</title>
<link rel="stylesheet" href="./Apple Pie Recipe_files/applepierecipe.css">
</head>
<body>

<div class="backgroundimage">

<img src="./Apple Pie Recipe_files/apple-pie.jpg" width="95%" alt="Apple pie ingredients">

<h1>Apple Pie</h1>

</div>

<p class="intro">This was my grandmother's apple pie recipe. I have never seen another one
quite like it. It will always be my favorite and has won me several first place
prizes in local competitions. I hope it becomes one of your favorites as well!</p>

<div class="foodprep">

<img src="./Apple Pie Recipe_files/recipe-info.png" width="30%" alt="1 hour and 30 minute preparation time. 8 servings. 512 calories.">

</div>

<hr>

<div id="ingredients">
Ingredients

<ul>
<li>1 recipe pastry for a 9 inch double crust pie</li>
<li>1/2 cup unsalted butter</li>
<li>3 tablespoons all-purpose flour</li>
<li>1/4 cup water</li>
<li>3 tablespoons all-purpose flour</li>
<li>1/4 cup water</li>
<li>1/2 cup white sugar</li>
<li>1/2 cup packed brown sugar</li>
<li>8 Granny Smith apples - peeled, cored and sliced</li>
</ul>

</div>

<div class="foodprep">

<img src="./Apple Pie Recipe_files/cooking-info.png" width="30%" alt="Preparation time, 30 minutes. Cook, 1 hour. Ready in 1 hour and 30 minutes">

</div>

<hr>

<div class="method">
<h3> Directions </h3>
<p>
1) Preheat oven to 425 degrees F (220 degrees C). Melt the butter in a saucepan. Stir in
flour to form a paste. Add water, white sugar and brown sugar, and bring to a boil. Reduce
temperature and let simmer.
<br>
2) Place the bottom crust in your pan. Fill with apples, mounded slightly. Cover with a
lattice work crust. Gently pour the sugar and butter liquid over the crust. Pour slowly so
that it does not run off.
<br>
3) Bake 15 minutes in the preheated oven. Reduce the temperature to 350 degrees F (175
degrees C). Continue baking for 35 to 45 minutes, until apples are soft.
</p>
</div>



</body></html>
Binary file added images/Apple Pie Recipe_files/apple-pie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions images/Apple Pie Recipe_files/applepierecipe.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
body {
font-family: sans-serif;
color: #47494c;
font-weight: lighter;
}

.backgroundimage {
position: relative;
background-position: bottom;
text-align: center;
height: 700px;
overflow: hidden;
}

h1 {
text-align: center;
position: absolute;
margin: auto;
top: 50%;
left:0;
right:0;
bottom:0;
color: white;
font-family: sans-serif;
font-size: 80px;
font-weight: lighter;
}

.intro {
font-family: sans-serif;
color: #47494c;
font-weight: lighter;
text-align: center;
padding: 40px 100px 40px 100px;
margin: 40px 100px 40px 100px;
font-size: 25px;
line-height: 1.25em;
}
.foodprep {
text-align: center;
position: relative;
}

hr { width:70%; height:1px; background: #fff }

#ingredients {
padding: 20px 100px;
margin: 20px 100px;
font-size: 20px;
line-height: 1.5em;
}

ul {
list-style-type: none;
}

ul li:before {
content: '\2014';
position: absolute;
margin-left: -20px;
}

.method {
padding: 20px 100px;
margin: 20px 100px;
font-size: 20px;
line-height: 1.5em;
}

h3 {
font-weight: lighter;
}
Binary file added images/Apple Pie Recipe_files/cooking-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Apple Pie Recipe_files/recipe-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/apple-pie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cooking-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/recipe-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions starter-code/basic-algorithms.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,94 @@


// Lorem ipsum generator

var hacker1 = "Michelle";
console.log("The driver's name is " + hacker1);

var hacker2 = prompt("What's your name?");
console.log("The navigators name is " +hacker2);

if(hacker1.length > hacker2.length) {
console.log("The Driver has the longest name, it has " + hacker1.length + " characters");
} else if(hacker1.length < hacker2.length) {
console.log("Yo, navigator got the longest name, it has " + hacker2.length + " characters")
} else {
console.log("wow, you both got equally long names, " + hacker1.length + "characters!!")
}

var i = 0;
var nuevo = "";

while (i < hacker1.length) {
if (i === 0) {
nuevo = nuevo + hacker1[i];
i++;
} else {
nuevo = nuevo + " " + hacker1[i];
i++;
}
}

console.log(nuevo.toUpperCase());

var j = hacker1.length-1;
var reverse = "";

while(j >= 0) {
reverse = reverse + hacker1[j]
j=j-1;
}
console.log(reverse);

if(hacker1 < hacker2) {
console.log("The driver's name goes first")
} else if(hacker1 > hacker2){
console.log("Yo, the navigator goes first definitely")
} else {
console.log("What?! You both got the same name?")
}

var bonusTime = prompt("Please introduce a palindrome").toUpperCase();

var compare = bonusTime.replace(/[^A-Z]/g, "");
var p = compare.length-1;
var alReves = "";
while(p >= 0) {
alReves = alReves + compare[p];
p--;
}
if(alReves === compare) {
console.log("You have a palindrome")
} else {
console.log("You do not have a palindrome")
}

var long = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a urna massa. Suspendisse ac iaculis purus. Praesent congue leo ligula, eget malesuada orci fermentum at. Duis hendrerit, dolor a volutpat mollis, felis arcu ullamcorper odio, ut maximus nisi mi ut orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum felis tellus, aliquet eget augue sed, bibendum hendrerit libero. Phasellus tincidunt leo imperdiet nisl laoreet sagittis. Aenean at massa malesuada diam ullamcorper accumsan. Ut non volutpat lacus. Nunc bibendum nulla sit amet enim vehicula finibus non id eros. Maecenas ultrices mollis imperdiet. Aenean euismod erat in dignissim facilisis. Fusce in turpis massa. In at tristique sem. Nullam et rutrum lectus, vel facilisis enim. Morbi ultrices facilisis mauris, eu molestie tellus commodo nec. Mauris sodales euismod magna, a porttitor sem commodo pharetra. Phasellus sed cursus eros. Pellentesque in leo dictum, auctor elit a, dignissim velit. Pellentesque sem massa, condimentum non ipsum eu, rutrum dapibus dui. Praesent mattis lectus magna. Suspendisse potenti. Fusce vel nisl accumsan, pulvinar libero sed, ornare orci. Cras fermentum dolor non risus rhoncus tempor. Proin lobortis nulla turpis, sed volutpat diam pellentesque sed. Nulla feugiat nunc dui, sit amet sodales magna ultricies at. Donec sapien nibh, vehicula a laoreet eu, ultricies laoreet nunc. Nullam ac dolor id metus mollis maximus vel non magna.";

spaces = 1;

w = 0;
while(w<long.length) {
if(long[w]===" ") {
spaces++;
w++;
} else {
w++
}
}
console.log("the number of the words is " +spaces);



x=0
con_et = 0
var array = long.split(" ")
while(x<array.length) {
if(array[x]=="et") {
con_et= con_et + 1
x++
} else {
x++
}
}
console.log(con_et)