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 1 commit
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
Prev Previous commit
Next Next commit
still working
  • Loading branch information
nos6 committed Jul 6, 2020
commit 2f210fe37213d9176236c95ec846157c14a2efce
Empty file removed week-1/0-freecodecamp/week2ex.js
Empty file.
21 changes: 15 additions & 6 deletions week-1/2-mandatory/4-tax.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

function calculateSalesTax(productPrice) {

return productPrice*20/100+productPrice ;
saleTax= 20/100;
return productPrice*saleTax+productPrice ;

}

Expand All @@ -25,14 +25,23 @@ console.log(calculateSalesTax(15));
wrote a function for this!)
*/

function addTaxAndFormatCurrency() {}

function addTaxAndFormatCurrency(productPrice) {

saleTax= 20/100;
currency= "£" ;


salePrice= productPrice* saleTax+ productPrice;
return currency + salePrice.toFixed(2) ;

}



function formatCurrency() {

}

/* ======= TESTS - DO NOT MODIFY =====
/* ======= TESTS - DO NOT MODIFY =====
There are some Tests in this file that will help you work out if your code is working.
To run these tests type `node 4-tax.js` into your terminal
*/
Expand Down
12 changes: 4 additions & 8 deletions week-2/2-mandatory/1-fix-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,12 @@ function first5() {
console.log(first5());


function get3rdIndex(arr) {
function get3rdIndex(array) {

let element= [11, 37, 62, 18, 19, 3, 30];


return element;
return array[3];
}



console.log(get3rdIndex(["fruit", "banana", "apple", "strawberry", "raspberry"]));
console.log(get3rdIndex([11, 37, 62, 18, 19, 3, 30]));

/* ======= TESTS - DO NOT MODIFY ===== */

Expand Down
14 changes: 7 additions & 7 deletions week-2/2-mandatory/2-function-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Write a function that:
- removes any spaces in the beginning or end of the strings
- removes any forward slashes (/) in the strings
- makes the string all lowercase
*//*
*/

function tidyUpString(strArr) {
let tidU =["/Daniel ", "irina ", " Gordon", "ashleigh "];

return ["daniel", "irina", "gordon","ashleigh"]

}

*/


/*
Complete the function to check if the variable `num` satisfies the following requirements:
Expand Down Expand Up @@ -40,8 +41,9 @@ Write a function that returns a copy of the given array arr, but with the elemen
The function must NOT change the original array, arr.
*/

//function remove(arr, index) {
//return; // complete this statement}
function remove(arr, index) {
return; // complete this statement
}


/*
Expand All @@ -52,7 +54,7 @@ Write a function that:
- numbers greater 100 must be replaced with 100
*/

//function formatPercentage(arr) {}
function formatPercentage(arr) {}



Expand Down Expand Up @@ -81,7 +83,6 @@ function test(test_name, actual, expected) {

/* ======= TESTS - DO NOT MODIFY ===== */


function arraysEqual(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;
Expand Down Expand Up @@ -142,4 +143,3 @@ test(
]
);