Skip to content
Open
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
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
</head>
<body>

</body>
</html>
14 changes: 14 additions & 0 deletions lab-01/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Driver: Ishamel Sunday
Navigator: Patrice Thomas

Code was worked on together.










# Assignment Overview: Lab 1

- Write a program that accepts user input and, based on that input, displays messages back to the user.
Expand Down
39 changes: 39 additions & 0 deletions lab-01/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
</head>
<body>
<h1>Where are you from game!</h1>
<p>Get ready to play a <b>very</b> <em>exciting</em> game</p>

<h2> Your Entire 411</h2>
<ul>
<li id = "Name-Of-User">Name</li>
<li id = "Your-Age">Age</li>
<li id ="Birth-Place">Continent</li>

<h2> My top 10 Soccer Team </h3>

<ol>
<li> Brazil</li>
<li>Belgium </li>
<li>Senegal </li>
<li> Ghana</li>
<li> Portugal</li>
<li> Mexico</li>
<li> Spain</li>
<li> England</li>
<li>USA </li>
<li>Haiti </li>
</ol>

</body>

<script src="main.js"></script>

</html>
18 changes: 18 additions & 0 deletions lab-01/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

/* body style */
body{
background-color:rgb(60, 196, 196);
font-family: "Helvetica", sans-serif;
font-size: 16px;
}

/* h1 and h2 style */
h1,h2 {
font-family: monospace;

}
/* list style*/
ol li {
font-weight: bold;
font-style: oblique;
}
112 changes: 112 additions & 0 deletions lab-01/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
//creating prompts for user to input value and storing those values using console.log
//wrapping Variables into for a given questiion into a function.

let nameIntoFunction = function() {
let name= prompt('What\s your name');
name = name;
console.log(name)
return name;
}
let newNameFunction = nameIntoFunction();




let ageIntoFunction = function() {
let age= prompt ('How old are you?');
age = age +' years old';
console.log(age);
return age;
}
let newAgeFunction = ageIntoFunction();



let continentIntoFunction = function(){
let continent= prompt('what continent are you from?');
continent = 'from '+ continent;
console.log(continent);
return continent;
}
let newContientFuntion =continentIntoFunction();



let greetingsIntoFunction = function(){
let greetings = confirm(name + " " + age + " " +continent);
console.log(greetings);
return greetings;
}
let newGreetingsFunction = greetingsIntoFunction();



//wrapping logic into for a given questiion into a function.
//replacing html with user input

let nameReplacement = function(){
if(name){
document.getElementById('Name-Of-User').innerText = name
}
};
nameReplacement();


let ageReplacement = function(){
if(age){
document.getElementById('Your-Age').innerText = age
}
};
ageReplacement();


let continentReplacement = function() {
if(continent){
document.getElementById('Birth-Place').innerText = continent
}
};
continentReplacement();




//testing putting values in an array to check if user is a human

let checkingHuman = function() {
let areYouHuman= [ 'like soccer', 'watch soccer','root for Brazil']

//creating a for loop function to check if the use answer affirmatively or negatively to the values in the loop
let emptyArray = []
let myResponse;

for(var i = 0; i<areYouHuman.length;i++) {
myResponse = confirm(name + ", " + "do you "+ areYouHuman[i] + "?")
emptyArray.push(myResponse)
};
console.log(emptyArray);
//inserting an "if and else" statement to confirm that the user is human based on his/her answers

if(emptyArray[0]==true && emptyArray[1] == true && emptyArray[2]== true ){
alert('Welcome my fellow human')
} else {
alert('I\'m sorry, I can\'t verify your humaneness')
}
};
checkingHuman();



/*Ask Zach to show the counter loop in Javascript

let count = 0;

for(let 1 =0; 1 < areYouHuman.length; i++) {
checkHuman = confirm( 'Do you" + 'likr soccer)
if (checkHuman) {
count++
}
}if (count= areYouHuman.length) {
alert('Welcome Human')
} else {
alert ('I'm sorry, I can't verify your humaneness)
}
Empty file added main.css
Empty file.
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let name= prompt('What\s your name');
name = 'i am ' + name;
console.log(name)

let age= prompt ('How old are you?');
age = age +' years old';
console.log(age);

let continent= prompt('what continent are you from?');
continent = 'from '+ continent;
console.log(continent);

let greetings = confirm(name + age + continent);
console.log(greetings);