diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000..c70fc154bf Binary files /dev/null and b/.DS_Store differ diff --git a/01-Fundamentals-Part-1/.DS_Store b/01-Fundamentals-Part-1/.DS_Store new file mode 100644 index 0000000000..6baece49c8 Binary files /dev/null and b/01-Fundamentals-Part-1/.DS_Store differ diff --git a/01-Fundamentals-Part-1/._.DS_Store b/01-Fundamentals-Part-1/._.DS_Store new file mode 100644 index 0000000000..8e82ed96c0 Binary files /dev/null and b/01-Fundamentals-Part-1/._.DS_Store differ diff --git a/01-Fundamentals-Part-1/._final b/01-Fundamentals-Part-1/._final new file mode 100644 index 0000000000..a42d8a73f8 Binary files /dev/null and b/01-Fundamentals-Part-1/._final differ diff --git a/01-Fundamentals-Part-1/._starter b/01-Fundamentals-Part-1/._starter new file mode 100644 index 0000000000..a703a65b93 Binary files /dev/null and b/01-Fundamentals-Part-1/._starter differ diff --git a/01-Fundamentals-Part-1/final/._index.html b/01-Fundamentals-Part-1/final/._index.html new file mode 100644 index 0000000000..a42d8a73f8 Binary files /dev/null and b/01-Fundamentals-Part-1/final/._index.html differ diff --git a/01-Fundamentals-Part-1/final/._script.js b/01-Fundamentals-Part-1/final/._script.js new file mode 100644 index 0000000000..a42d8a73f8 Binary files /dev/null and b/01-Fundamentals-Part-1/final/._script.js differ diff --git a/01-Fundamentals-Part-1/starter/._assignments.js b/01-Fundamentals-Part-1/starter/._assignments.js new file mode 100644 index 0000000000..99c03224a9 Binary files /dev/null and b/01-Fundamentals-Part-1/starter/._assignments.js differ diff --git a/01-Fundamentals-Part-1/starter/._index.html b/01-Fundamentals-Part-1/starter/._index.html new file mode 100644 index 0000000000..1c1434f066 Binary files /dev/null and b/01-Fundamentals-Part-1/starter/._index.html differ diff --git a/01-Fundamentals-Part-1/starter/._script.js b/01-Fundamentals-Part-1/starter/._script.js new file mode 100644 index 0000000000..4983cf09d0 Binary files /dev/null and b/01-Fundamentals-Part-1/starter/._script.js differ diff --git a/01-Fundamentals-Part-1/starter/assignments.js b/01-Fundamentals-Part-1/starter/assignments.js new file mode 100644 index 0000000000..bbd747ee6f --- /dev/null +++ b/01-Fundamentals-Part-1/starter/assignments.js @@ -0,0 +1,132 @@ +const country = 'United States'; +const continent = 'North America'; +let population = 328000000; +let isIsland = false; +const language = 'English'; + +console.log(country); +console.log(continent); +console.log(population); +console.log(isIsland); +console.log(language); + +const halfPopulation = population / 2 / 2; +console.log(halfPopulation); +population++; +console.log(population); +const hasMorePopulationThanFinlans = population > 6000000; +console.log(hasMorePopulationThanFinlans); +const lessThanAverageCountryPopulation = population < 33000000; +const description = `${country} is in ${continent} and its ${population} million people speak ${language}`; +console.log(description); + + +//Coding Challenge #1 +const marksMass = 82; +const MarksHeight = 1.95; +const JohnsMass = 78; +const JohnsHeight = 1.68; + +const marksBMI = marksMass / (MarksHeight * MarksHeight); +const johnsBMI = JohnsMass / (JohnsHeight * JohnsHeight); + +const markHigherBMI = marksMass > johnsBMI; + +console.log(marksBMI, johnsBMI); +const averagePopulation = 33000000; +if (population > averagePopulation) { + console.log(`${country} population is about average`); + +} else { + console.log(`${country} population is ${averagePopulation - population} below averaeg `); +} + + +if (marksBMI > johnsBMI) { + + console.log(`Marks BMI(${marksBMI}) is hgher then Johns BMI(${johnsBMI})`); + +} else { + console.log(`Johns BMI(${johnsBMI}) is higher then Marks BMI(${marksBMI})`); +} + +console.log('123' < 56); + +// let numNeighbours = Number(prompt(`How many neighbours country does your country have ?`)); + +// if (numNeighbours === 1) { + +// console.log(`Only 1 neigbouring country`); +// } else if (numNeighbours > 1) { +// console.log(`Greater then 1 neigbouring country`); + +// } else { +// console.log(`No borders`); + +// } + +//LECTURE: Logical Operators + + +if (language === 'English' && population <= 50000000 && isIsland == false) { + console.log(`Your should live in the ${country}`); +} else { + console.log(`${country} doesnt meet your criteria`); + +} + + +//LECTURE: The switch Statement + + +switch (language) { + case `chinese`, `manderine`, `Chinese`: + console.log(`MOST number of native speakers`); + break; + case `spanish`: + console.log(`2nd most native speakers`); + break; + case `english`, `English`: + console.log(`3rd most native speakers`) + break; + + default: + console.log(`also a great language too`); + break; +} + +//LECTURE: The Conditional (Ternary) Operator +console.log(`${country} populations is ${population > 33000000 ? "above" : "below"} average`) +//const populationOver33mil = population > 33000000 ? console.log(`${ country } is above average`) : console.log(`${ country } is below averae`); + + +//Coding Challenge #3 + +const dolphinsScore1 = 98; +const dolphinsScore2 = 109; +const dolphinsScore3 = 96; + +const koalasScore1 = 88; +const koalasScore2 = 91; +const koalasScore3 = 110; +const MINSCORE = 100; + + +const dolphinsAverageScore = (dolphinsScore1 + dolphinsScore2 + dolphinsScore3) / 3; +const koalasAverageScore = (koalasScore1 + koalasScore2 + koalasScore3) / 3; + +if (dolphinsAverageScore >= MINSCORE && dolphinsAverageScore > koalasAverageScore) { + console.log(`Dolphines Avergge score(${dolphinsAverageScore}) greater than koalas average score(${koalasAverageScore})`); +} else if (dolphinsAverageScore < koalasAverageScore && koalasAverageScore >= MINSCORE) { + console.log(`Koalas Avergge score(${koalasAverageScore}) greater than dalphins average score(${dolphinsAverageScore})`); + +} else if (dolphinsAverageScore === koalasAverageScore && koalasAverageScore >= MINSCORE) { + console.log(`We have a draw`); +} + +//Coding Challenge #4 +const bill = 275; +const tip = bill >= 50 && bill <= 300 ? bill * (15 / 100) : bill * (20 / 100); +console.log(`${tip}% `); + +console.log(`The bill was ${bill}, the tip was ${tip}, and the total value ${bill + tip}`); diff --git a/01-Fundamentals-Part-1/starter/index.html b/01-Fundamentals-Part-1/starter/index.html index 59529c7923..2338a305b0 100755 --- a/01-Fundamentals-Part-1/starter/index.html +++ b/01-Fundamentals-Part-1/starter/index.html @@ -1,29 +1,34 @@ -
- - - -