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
50 changes: 37 additions & 13 deletions week-1/calc.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">

<title>calc</title>

<script type="text/javascript">
// data (variables)

// functions

</script>
<title>Calculator</title>
<h1>Welcome to my Calculate Page</h1>
<div class="mainmenu">
<a href="./index.html">Home</a>
<a href="./team.html">Team</a>
<a href="./calc.html">Calculator</a>
</div>
<hr>
</head>

<body>


<p>Press <strong>F12</strong> on your keyboard to view results in the console view.</p>
<script>
var a= "12";
var b= "2";
function print_vals(){
console.log("a = " + a, "b = " + b)
}

function add(a, b){
return (+a) + (+b)
}
function substract(a, b){
return (+a) - (+b)
}
function multiply(a, b){
return (+a) * (+b)
}
function divide(a, b){
return (+a) / (+b)
}


</script>
<button onclick="print_vals();">Numbers</button>
<button onclick="console.log(add(a, b));">Add</button>
<button onclick="console.log(substract(a, b));">Substact</button>
<button onclick="console.log(multiply(a, b));">Multiply</button>
<button onclick="console.log(divide(a, b));">Divide</button>
</body>
</html>
</html>
36 changes: 0 additions & 36 deletions week-1/example-to-study.html

This file was deleted.

32 changes: 19 additions & 13 deletions week-1/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">

<title>home page</title>

<script type="text/javascript">
// data (variables)

// functions

</script>
<title>Homework JS-1</title>
<h1>Welcome to my HomePage</h1>
<p>This is a JavaScript Homework WepPage of Week 1</p>
<div class="mainmenu">
<a href="./index.html">Home</a>
<a href="./team.html">Team</a>
<a href="./calc.html">Calculator</a>
</div>
<hr>
</head>

<body>
<h1>week 1 index.html</a>
<!-- delete this button when you're ready to start! -->
<a href="./example-to-study.html">example to study</a>

<p>Press <strong>Button</strong> to print project details to the console.</p>
<p>Press <strong>F12</strong> on your keyboard to view project details in the console view.</p>
<script>
var obj = { name : "Mesut", link : "https://github.com/Efiloglu/javascript-1-cross-module/tree/master/week-1", description : "js homework " };
function print_deets() {
console.log(obj);
}
</script>
<button onclick="print_deets();">Project Details</button> <br>
</body>
</html>
39 changes: 27 additions & 12 deletions week-1/team.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">

<title>team page</title>

<script type="text/javascript">
// data (variables)

// functions

</script>
<title>Team</title>
<h1>Welcome to my Team Page</h1>
<div class="mainmenu">
<a href="./index.html">Home</a>
<a href="./team.html">Team</a>
<a href="./calc.html">Calculator</a>
</div>
<hr>
</head>

<body>

<p>Press <strong>F12</strong> on your keyboard to view Team details in the console view.</p>
<script>
var team_name = "HYF-Belgium";
var team_members= ["Jamal","Berihu","Saliha","Ramzi","Rahime","Harun","Hakan","Melrose","Nelson","Kelemu","Ebru","Mesut","Heighine","Fatma","Aimal"];

function print_team_name() {
console.log(team_name);
}
function print_team_members() {
console.log("Team members are : " + team_members);
}
function print_both(){
console.log(team_name + " JS Homework - 1 Team : " + team_members);
}
</script>
<button onclick="print_team_name();">Team Name</button>
<button onclick="print_team_members();">Team Members</button>
<button onclick="print_both();">Both</button>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions week-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

| | your Emoji | your comments | coach emoji | coach comments |
| --- | --- | --- | --- | --- |
| Home page | | | | |
| Team page | | | | |
| Calc page | | | | |
| Home page |:+1: | | | |
| Team page |:+1: | | | |
| Calc page |:+1: | | | |


---
Expand Down
26 changes: 26 additions & 0 deletions week-2/calc/data-&-functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var n1 = 12;
var n2 = 2;

function print_vals(a,b){
console.log(a,b);
}

function do_math(a,b,func){
console.log(func(a,b));
}

function add(a,b) {
return a+b;
}

function subtract(a,b){
return a-b;
}

function multiply(a,b){
return a*b;
}

function divide(a,b){
return a/b;
}
8 changes: 0 additions & 8 deletions week-2/calc/functions-data.js

This file was deleted.

27 changes: 27 additions & 0 deletions week-2/calc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Calculator</title>
<h1>Welcome to my Calculate Page</h1>
<div class="mainmenu">
<a href="../index.html">Home</a>
<a href="../team/index.html">Team</a>
<a href="../calc/index.html">Calculator</a>
</div>
<hr>
<script type="text/javascript" src="./data-&-functions.js"></script>
</head>

<body>
<p>Press <strong>F12</strong> on your keyboard to view results in the console view.</p>
<h1>CALCULATOR</h1>
<button id="print_val">a and b</button> <br>
<button id="add_val">Add</button> <br>
<button id="subt_val">Subtract</button> <br>
<button id="multi_val">Multiply</button> <br>
<button id="div_val">Divide</button> <br>
<hr>
<script type="text/javascript" src="./onclicks.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions week-2/calc/onclicks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var printVal = document.getElementById("print_val");
var addVal = document.getElementById("add_val");
var subtVal = document.getElementById("subt_val");
var multiVal = document.getElementById("multi_val");
var divVal = document.getElementById("div_val");

printVal.onclick = function() {print_vals(n1, n2);}
addVal.onclick = function() {do_math(n1, n2, add);}
subtVal.onclick = function() {do_math(n1, n2, subtract);}
multiVal.onclick = function() {do_math(n1, n2, multiply);}
divVal.onclick = function() {do_math(n1, n2, divide);}
11 changes: 11 additions & 0 deletions week-2/data-&-functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

var project_object= {
name :"Europe Education Guide",
link :"www.eduadviser.org",
Description :"An Education Consultancy"
};

function print_deets(obj)
{
console.log(obj);
}
27 changes: 17 additions & 10 deletions week-2/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="./data-&-functions.js"></script>

<title>home page</title>

<script type="text/javascript" src="./scripts.js"></script>

</script>
<title>Homework JS-2</title>
<h1>Welcome to my HomePage</h1>
<p>This is a JavaScript Homework WepPage of Week 1</p>
<div class="mainmenu">
<a href="./index.html">Home</a>
<a href="./team/index.html">Team</a>
<a href="./calc/index.html">Calculator</a>
</div>
<hr>
</head>

<body>
<h1>week 1 index.html</a>
<!-- delete this button when you're ready to start! -->
<a href="./example-to-study/index.html">example to study</a>

<p>Press <strong>Button</strong> to print project details to the console.</p>
<p>Press <strong>F12</strong> on your keyboard to view project details in the console view.</p>

<button id="details-button">Project Details</button> <br>
<script type="text/javascript" src="./onclicks.js"></script>
</body>
</html>
</html>
4 changes: 4 additions & 0 deletions week-2/onclicks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var print_details_button = document.getElementById("details-button");
print_details_button.onclick = function() {
print_deets(project_object);
}
5 changes: 0 additions & 5 deletions week-2/scripts.js

This file was deleted.

20 changes: 20 additions & 0 deletions week-2/team/data-&-functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var team_name = "EEG";
var team_members = ["Mesut","Nelson","Ramiz","Jamal"];

function print_team_name(TeamName)
{
console.log("Team name is : " + TeamName);
}
function print_team_members(TeamMembers)
{
console.log("Team members are : ");
for(let i=0; i<TeamMembers.length ;i++)
{
console.log(TeamMembers[i]);
}
}
function introduction(TeamName, TeamMembers)
{
print_team_name(TeamName);
print_team_members(TeamMembers);
}
8 changes: 0 additions & 8 deletions week-2/team/functions-data.js

This file was deleted.

Loading