Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
8297ed8
1-syntax-errors.js is finished
ISTANBULBEKLE Jun 19, 2020
f81fbca
2-logic-error.js is finished.
ISTANBULBEKLE Jun 19, 2020
d037e1a
3-function-output is finished.
ISTANBULBEKLE Jun 19, 2020
1fb81d3
4.tax.js is finished.
ISTANBULBEKLE Jun 19, 2020
ba05a63
1-currency-conversion.js is done.
ISTANBULBEKLE Jun 19, 2020
aca9813
2-pipping.js is done.
ISTANBULBEKLE Jun 19, 2020
4e7d44e
3-magic-8-ball.js is done
ISTANBULBEKLE Jun 19, 2020
56cb0a7
2-pipping.js is revised
ISTANBULBEKLE Jun 19, 2020
669e81f
exercises are done.
ISTANBULBEKLE Jun 19, 2020
832fe6e
functions-nested is done.
ISTANBULBEKLE Jun 19, 2020
7f08737
Update 2-piping.js
ISTANBULBEKLE Jun 19, 2020
5e0deff
exerceises A-D are done.
ISTANBULBEKLE Jun 20, 2020
28dde7a
Update exercise.js
ISTANBULBEKLE Jun 20, 2020
e63321b
exercises F-G are done
ISTANBULBEKLE Jun 20, 2020
12250e1
madatory 1 is began.
ISTANBULBEKLE Jun 21, 2020
08a2832
1-fix-functions.js is done.
ISTANBULBEKLE Jun 21, 2020
b1d8ab2
Update 2-function-creation.js
ISTANBULBEKLE Jun 21, 2020
95994cc
Update exercise.js
ISTANBULBEKLE Jun 21, 2020
b2f8012
2-function-creation.js 2nd qua answered
ISTANBULBEKLE Jun 21, 2020
33bc644
Update 2-function-creation.js
ISTANBULBEKLE Jun 21, 2020
49a7402
Update 2-function-creation.js
ISTANBULBEKLE Jun 22, 2020
763cb6b
2-function-creation.js is done
ISTANBULBEKLE Jun 22, 2020
7a7aced
wee-1 and wee-2 exercises revised
ISTANBULBEKLE Jun 22, 2020
e78e060
Update 4-sorting-algorithm.js
ISTANBULBEKLE Jun 22, 2020
ebec3a5
3-playing-computer is done
ISTANBULBEKLE Jun 23, 2020
5fa1a98
4-sorting-algorithm.js is done.
ISTANBULBEKLE Jun 23, 2020
22d4375
Merge branch 'master' into master
ISTANBULBEKLE Jun 23, 2020
50df84b
Update 1-radio-stations.js
ISTANBULBEKLE Jun 23, 2020
00d2d38
1-fix-functions.js is revised
ISTANBULBEKLE Jun 24, 2020
b6136a1
Update 1-fix-functions.js
ISTANBULBEKLE Jun 24, 2020
35b896b
Update 1-radio-stations.js
ISTANBULBEKLE Jun 24, 2020
0159a37
1-radio algorithm is modified
ISTANBULBEKLE Jun 24, 2020
81df60e
1-radio-stations.js is done.
ISTANBULBEKLE Jun 24, 2020
45d23e5
Update 4-sorting-algorithm.js
ISTANBULBEKLE Jun 24, 2020
a1a5156
4-sorting-algorithm more solution added
ISTANBULBEKLE Jun 25, 2020
59afcf8
exercise array-find is done
ISTANBULBEKLE Jun 30, 2020
326420f
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
2ddf177
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
7a6575d
Update README.md
ISTANBULBEKLE Jun 30, 2020
bb70df3
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
ede70ed
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
7ab8307
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
89f6146
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
48e6fdf
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
9540ca7
f-array-forEach is done
ISTANBULBEKLE Jun 30, 2020
6755d8b
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
22a8408
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
0c78bbf
G-array-methods second part is done
ISTANBULBEKLE Jun 30, 2020
ff172d6
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
5660289
Update README.md
ISTANBULBEKLE Jun 30, 2020
7c38696
Update exercise3.js
ISTANBULBEKLE Jun 30, 2020
d118c9d
Update exercise2.js
ISTANBULBEKLE Jun 30, 2020
f9979cc
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
d27c542
Update exercise.js
ISTANBULBEKLE Jun 30, 2020
1b42631
Update 2-bush-berries.js
ISTANBULBEKLE Jul 1, 2020
ee2d7c6
Update 3-space-colonies.js
ISTANBULBEKLE Jul 1, 2020
3bd33a3
Update 1-oxygen-levels.js
ISTANBULBEKLE Jul 1, 2020
6715f72
Update 3-space-colonies.js
ISTANBULBEKLE Jul 1, 2020
63e15a5
Update exercise.js
ISTANBULBEKLE Jul 1, 2020
07c1db8
Update 3-space-colonies.js
ISTANBULBEKLE Jul 1, 2020
2b37a11
Update 4-eligible-students.js
ISTANBULBEKLE Jul 1, 2020
f14573e
5-journey-planner.js is done
ISTANBULBEKLE Jul 1, 2020
5fc425d
Update 4-eligible-students.js
ISTANBULBEKLE Jul 1, 2020
97ee772
Update 5-journey-planner.js
ISTANBULBEKLE Jul 1, 2020
c73998d
Update 6-lane-names.js
ISTANBULBEKLE Jul 1, 2020
165266b
Update 7-password-validator.js
ISTANBULBEKLE Jul 1, 2020
0f3e181
Update 1-oxygen-levels.js
ISTANBULBEKLE Jul 2, 2020
99888c2
Update 2-bush-berries.js
ISTANBULBEKLE Jul 2, 2020
43b1332
Update 3-space-colonies.js
ISTANBULBEKLE Jul 2, 2020
2e52f4c
Update 4-eligible-students.js
ISTANBULBEKLE Jul 2, 2020
4599f90
1-cedit-car-validator is modified
ISTANBULBEKLE Jul 4, 2020
9b64ef3
Update exercise.js
ISTANBULBEKLE Jul 4, 2020
8b4f42e
Update .DS_Store
ISTANBULBEKLE Jul 4, 2020
acbc087
Update .DS_Store
ISTANBULBEKLE Jul 4, 2020
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
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions week-1/1-exercises/C-variables/exercise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Start by creating a variable `greeting`
let greeting = "Hello world";

console.log(greeting);
console.log(greeting);
console.log(greeting);
5 changes: 3 additions & 2 deletions week-1/1-exercises/D-strings/exercise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Start by creating a variable `message`

console.log(message);
let myString= "I am a string."
let typeOfVariable = typeof(myString);
console.log("I am a " + typeOfVariable + ".");
5 changes: 3 additions & 2 deletions week-1/1-exercises/E-strings-concatenation/exercise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Start by creating a variable `message`

console.log(message);
let greeting= "Hello, my name is ";
let myName= "Ekip";
console.log(`${greeting}${myName}.`);
4 changes: 3 additions & 1 deletion week-1/1-exercises/F-strings-methods/exercise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Start by creating a variable `message`
let myName=" Ekip";
let lengthOfName= myName.length;

console.log(message);
console.log(`My anme is ${myName} and my name is ${lengthOfName} characters long.`);
8 changes: 6 additions & 2 deletions week-1/1-exercises/F-strings-methods/exercise2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const name = " Daniel ";
let myName= " Ekip ";
let whiteSpaceDelated= myName.trim();
console.log(whiteSpaceDelated);
let lengthOfName= myName.length;
let msg= `My name is ${whiteSpaceDelated} and my name is ${lengthOfName} characters long.`;

console.log(message);
console.log(msg.trim());
8 changes: 8 additions & 0 deletions week-1/1-exercises/G-numbers/exercise.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
// Start by creating a variables `numberOfStudents` and `numberOfMentors`

let numberOfStudents= 24;
let numberOfMentors=18;
let totalNumbersOfAttandents= numberOfStudents + numberOfMentors;

console.log(`The numbers of students is:${numberOfStudents}`);
console.log(`The numbers of mentors is:${numberOfMentors}`);
console.log("The numbers of mentors and students in total is:" + " " + totalNumbersOfAttandents);
3 changes: 3 additions & 0 deletions week-1/1-exercises/I-floats/exercise.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
var numberOfStudents = 15;
var numberOfMentors = 8;
var totalNumberOfAttandents= numberOfStudents + numberOfMentors;
console.log("Percentage students:" + Math.round((numberOfStudents/totalNumberOfAttandents) * 100));
console.log("Percentage mentors:" + Math.round((numberOfMentors/totalNumberOfAttandents) * 100));
7 changes: 5 additions & 2 deletions week-1/1-exercises/J-functions/exercise.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
function halve(number) {
// complete the function here
return (number/2);
}

var result = halve(12);

console.log(result);
console.log(halve(4));
console.log(halve(8));
console.log(halve(14));

1 change: 1 addition & 0 deletions week-1/1-exercises/J-functions/exercise2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function triple(number) {
// complete function here
return (number * 3);
}

var result = triple(12);
Expand Down
5 changes: 3 additions & 2 deletions week-1/1-exercises/K-functions-parameters/exercise.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Complete the function so that it takes input parameters
function multiply() {
function multiply(a, b) {
// Calculate the result of the function and return it
return a *b;
}

multiply();
// Assign the result of calling the function the variable `result`
var result = multiply(3, 4);

Expand Down
3 changes: 3 additions & 0 deletions week-1/1-exercises/K-functions-parameters/exercise2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Declare your function first

function divide (a,b){
return (a/b);
}
var result = divide(3, 4);

console.log(result);
3 changes: 3 additions & 0 deletions week-1/1-exercises/K-functions-parameters/exercise3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Write your function here

function createGreeting (name){
return "Hello, my name is " + name;
}
var greeting = createGreeting("Daniel");

console.log(greeting);
6 changes: 4 additions & 2 deletions week-1/1-exercises/K-functions-parameters/exercise4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Declare your function first

function addNumbers (a,b){
return a + b;
}
// Call the function and assign to a variable `sum`

var sum = addNumbers (13,124);
console.log(sum);
4 changes: 3 additions & 1 deletion week-1/1-exercises/K-functions-parameters/exercise5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Declare your function here

function createLongGreeting (name,age){
return `Hello, my name is ${name} and I'm ${age} years old.`
}
const greeting = createLongGreeting("Daniel", 30);

console.log(greeting);
30 changes: 30 additions & 0 deletions week-1/1-exercises/L-functions-nested/exercise.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
////////////////////////////////////////////////////////////////////////////////

// Write a program that displays the percentage of students and mentors in the group.
// The percentage should be rounded to the nearest whole number

function calculatePercentage (numberOfStudents, numbersOfMentors){
let percentageStudents= (numberOfStudents/(numberOfStudents+numbersOfMentors)) * 100;
let percentageMentors= (numbersOfMentors/(numbersOfMentors+numberOfStudents)) * 100;
return `Percentage of students is ${Math.round(percentageStudents)}% and percentage of mentors is ${Math.round(percentageMentors)}%.`;
}
calculatePercentage();

console.log (calculatePercentage (15,8));




///////////////////////////////////////////////////////////////////////////////////




var mentor1 = "Daniel";
var mentor2 = "Irina";
var mentor3 = "Mimi";
var mentor4 = "Rob";
var mentor5 = "Yohannes";


var mentorsNames= ["Daniel","Irina", "Mimi","Rob", "Yohannes"];

for (var i=0; i < mentorsNames.length; i++){
console.log("HELLO " + (mentorsNames[i].toUpperCase()));
}

14 changes: 8 additions & 6 deletions week-1/2-mandatory/1-syntax-errors.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// There are syntax errors in this code - can you fix it to pass the tests?

function addNumbers(a b c) {
function addNumbers(a, b, c) {
return a + b + c;
}

function introduceMe(name, age)
return "Hello, my name is " + name "and I am " age + "years old";
function introduceMe(name, age){
return `Hello, my name is ${name} and I am ${age} years old`;
}


function getTotal(a, b) {
total = a ++ b;
function getRemainder(a, b) {
total = a % b;

// Use string interpolation here
return "The total is %{total}"
return `The remainder is ${total}`;
}

/* ======= TESTS - DO NOT MODIFY =====
Expand Down
7 changes: 3 additions & 4 deletions week-1/2-mandatory/2-logic-error.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// The syntax for this function is valid but it has an error, find it and fix it.

function trimWord(word) {
return wordtrim();
return word.trim();
}

function getWordLength(word) {
return "word".length()
return word.length;
}

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

/* ======= TESTS - DO NOT MODIFY =====
Expand Down
17 changes: 14 additions & 3 deletions week-1/2-mandatory/3-function-output.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
// Add comments to explain what this function does. You're meant to use Google!
function getNumber() {

/* 'Math.random()' function returns a random number from 0 to 1 (not including 1).
Here that random number will be multiplied with 10 and return out of the function.
So, the random numbers will be between 0 and 9.99999 but not 10. */

function getNumber() {
return Math.random() * 10;
}

// Add comments to explain what this function does. You're meant to use Google!

/* The concat() method is used to join two or more arrays.This method does
not change the existing arrays, but returns a new array, containing the values
of the joined arrays. */

function s(w1, w2) {
return w1.concat(w2);
}

function concatenate(firstWord, secondWord, thirdWord) {
// Write the body of this function to concatenate three words together.
// Look at the test case below to understand what this function is expected to return.
// Write the body of this function to concatenate three words together
// Look at the test case below to understand what to expect in return
return `${firstWord} ${secondWord} ${thirdWord}`;
}

/* ======= TESTS - DO NOT MODIFY =====
Expand Down
13 changes: 11 additions & 2 deletions week-1/2-mandatory/4-tax.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
A business requires a program that calculates how much sales tax to charge
Sales tax is 20% of the price of the product
*/
let priceWithTaxUnit;

function calculateSalesTax() {}
function calculateSalesTax(priceOfOneUnit) {
priceWithTaxUnit = priceOfOneUnit + (priceOfOneUnit * 0.2);
return priceWithTaxUnit;
}
// console.log(calculateSalesTax(15));

/*
CURRENCY FORMATTING
Expand All @@ -17,7 +22,11 @@ function calculateSalesTax() {}
Remember that the prices must include the sales tax (hint: you already wrote a function for this!)
*/

function formatCurrency() {}
function formatCurrency(originalPrice) {
let taxAdjustedPrice = calculateSalesTax(originalPrice);
//console.log("£" + taxAdjustedPrice.toFixed(2));
return "£" + taxAdjustedPrice.toFixed(2);
}

/* ======= TESTS - DO NOT MODIFY =====
There are some Tests in this file that will help you work out if your code is working.
Expand Down
13 changes: 11 additions & 2 deletions week-1/3-extra/1-currency-conversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
Write a function that converts a price to USD (exchange rate is 1.4 $ to £)
*/

function convertToUSD() {}
function convertToUSD(currencyPound) {
let currencyDollar = currencyPound * 1.4;
return currencyDollar;
}
//console.log(convertToUSD(20));

/*
CURRENCY FORMATTING
Expand All @@ -15,7 +19,12 @@ function convertToUSD() {}
They have also decided that they should add a 1% fee to all foreign transactions, which means you only convert 99% of the £ to BRL.
*/

function convertToBRL() {}
function convertToBRL(poundCurrency) {
let currencyBrl = poundCurrency * 5.7;
let currencyBrlWithTransactionFee = currencyBrl + (0.01 * currencyBrl);
return currencyBrlWithTransactionFee;
}
//console.log(convertToBRL(40));

/* ======= TESTS - DO NOT MODIFY =====
There are some Tests in this file that will help you work out if your code is working.
Expand Down
33 changes: 24 additions & 9 deletions week-1/3-extra/2-piping.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,41 @@
the final result to the variable goodCode
*/

function add() {

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

function multiply() {
//console.log(add (3.2, 6.5));

function multiply(a, b) {
return a * b;
}
multiply();
//console.log(multiply(3,6));

function format() {

function format(number1) {
//let formattedNumber = `£${number1}`;
//console.log(`£ ${number1}`);
return `£${number1}`;
}
format ();

const startingValue = 2

const startingValue = 2;
function allTogetherMath() {
return "£" + ((startingValue + 10) * 2);
}
// Why can this code be seen as bad practice? Comment your answer.
let badCode =
/* StartingValue has been declared as a const value and before the function,
however we can just declare as an argument in the function */
let badCode = allTogetherMath()

/* BETTER PRACTICE */

let goodCode =
function allTogetherGoodPractice (startValue){
return "£ " + ((startValue + 10) * 2);
}
let goodCode = allTogetherGoodPractice(2);

/* ======= TESTS - DO NOT MODIFY =====
There are some Tests in this file that will help you work out if your code is working.
Expand Down
Loading