Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skill Sharpening Project by Diandre, Jennifer and Vandhana #264

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8d1e29d
compare types
Vandhana-Mohan Oct 14, 2022
512b896
Diandre's 1st function commit
DiandreMiller Oct 14, 2022
b91eb9b
flip signs
Vandhana-Mohan Oct 14, 2022
d14b85c
Diandre first three changes in data types
DiandreMiller Oct 14, 2022
6294ca1
Data types and control flow Diandre Miller
DiandreMiller Oct 15, 2022
e565d93
datatypes.js
Vandhana-Mohan Oct 15, 2022
fc4d0e3
functions.js
Vandhana-Mohan Oct 15, 2022
0b59b02
control-flow.js
Vandhana-Mohan Oct 15, 2022
dee43bd
Diandre Arrays.js
DiandreMiller Oct 15, 2022
a0c23b5
arrays.js
Vandhana-Mohan Oct 15, 2022
bb63248
Final arrays commit
DiandreMiller Oct 15, 2022
8d7c236
First three objects done Diandre
DiandreMiller Oct 15, 2022
86c48c9
objects.js
Vandhana-Mohan Oct 15, 2022
33ede0e
Diandre final commit for objects
DiandreMiller Oct 15, 2022
580a52d
Diandre first loop
DiandreMiller Oct 15, 2022
8d43fc0
loops.js
Vandhana-Mohan Oct 15, 2022
49bf1f9
Diandre last loops
DiandreMiller Oct 15, 2022
4d84b7f
Diandre first loops
DiandreMiller Oct 15, 2022
30c8a25
functions.js vandhana
Vandhana-Mohan Oct 15, 2022
54bf7a4
datatypes.js vandhana
Vandhana-Mohan Oct 15, 2022
e7610d6
Diandre first commit, lab 07
DiandreMiller Oct 15, 2022
ee76117
Diandre final 07 commits
DiandreMiller Oct 15, 2022
5a0f2bc
Diandre first 08 commit
DiandreMiller Oct 15, 2022
3dd122e
even more loops vandhana
Vandhana-Mohan Oct 15, 2022
04777a8
accessing objects vandhana
Vandhana-Mohan Oct 15, 2022
2ab7dae
Diandre final 08 commits
DiandreMiller Oct 15, 2022
c2a49c7
word problems vandhana
Vandhana-Mohan Oct 15, 2022
150b1c9
first set and second set
Jennifer1288 Oct 16, 2022
d6520da
third set
Jennifer1288 Oct 16, 2022
dbec536
4th set
Jennifer1288 Oct 16, 2022
387bbcf
set 3
Jennifer1288 Oct 16, 2022
42f6ab9
st 4
Jennifer1288 Oct 16, 2022
cfcbece
set 5
Jennifer1288 Oct 16, 2022
6634c39
set 5
Jennifer1288 Oct 17, 2022
80790a9
set 6
Jennifer1288 Oct 17, 2022
f361071
set 7
Jennifer1288 Oct 17, 2022
7cd8ac1
last set
Jennifer1288 Oct 17, 2022
7e829ee
comments
DiandreMiller Oct 17, 2022
d9d452e
Add comments
Vandhana-Mohan Oct 18, 2022
6419ff3
Add comments
Vandhana-Mohan Oct 18, 2022
2d5b014
Add comments
Vandhana-Mohan Oct 18, 2022
51c3050
Add comments
Vandhana-Mohan Oct 18, 2022
fcd5d95
Add comments
Vandhana-Mohan Oct 18, 2022
faa4896
Add comments
Vandhana-Mohan Oct 18, 2022
76b41c1
Add comments
Vandhana-Mohan Oct 18, 2022
18e5854
no changes made
DiandreMiller Oct 20, 2022
6ba4e73
set 07
Jennifer1288 Oct 20, 2022
8f9e6e1
Commit change 06
DiandreMiller Oct 20, 2022
ec0ff2c
set 07
Jennifer1288 Oct 20, 2022
bac9c31
Remove solution for loop
Vandhana-Mohan Oct 20, 2022
9008b42
set 08
Jennifer1288 Oct 20, 2022
e665753
Changes to functions
Vandhana-Mohan Oct 20, 2022
026a318
Changes to functions
Vandhana-Mohan Oct 20, 2022
1f3ebf4
Final commit
DiandreMiller Oct 20, 2022
37e2527
Changes to functions
Vandhana-Mohan Oct 20, 2022
6c94b65
no changes made
DiandreMiller Oct 20, 2022
269d51b
Changes to functions
Vandhana-Mohan Oct 20, 2022
2d1836c
Merge branch 'DiandreMiller' into vandhana-jennifer-diandre
abbreviatedman Oct 24, 2022
e8c1ff1
Merge branch 'jennifer' into vandhana-jennifer-diandre
abbreviatedman Oct 24, 2022
8c2898c
Removes test changes.
abbreviatedman Oct 24, 2022
5df3b28
Merge pull request #1 from abbreviatedman/vandhana-jennifer-diandre
Vandhana-Mohan Oct 24, 2022
18067a4
Add Comments
Vandhana-Mohan Oct 24, 2022
22bccca
Merge branch 'main' of https://github.com/Vandhana-Mohan/8-0-skill-sh…
Vandhana-Mohan Oct 24, 2022
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
69 changes: 58 additions & 11 deletions src/01-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
* alwaysTrue();
* //> true
*/
function alwaysTrue() {}
function alwaysTrue() {
return true
}

/**
* greet()
Expand All @@ -24,7 +26,10 @@ function alwaysTrue() {}
* greet("Ian");
* //> "Hello, Ian."
*/
function greet() {}
function greet(name) {

return `Hello, ${name}.`
}

/**
* add()
Expand All @@ -39,7 +44,9 @@ function greet() {}
* add(10, 20);
* //> 30
*/
function add() {}
function add(a,b) {
return a + b
}

/**
* multiply()
Expand All @@ -54,12 +61,15 @@ function add() {}
* multiply(2, 5);
* //> 10
*/
function multiply() {}
function multiply(a,b) {
return a*b
}

/**
* average()
* ---------------------
* Returns the average of two numbers. You can get the average by adding up all numbers and then dividing by how many numbers were added.
* Returns the average of two numbers. You can get the average by adding up all
* numbers and then dividing by how many numbers were added.
*
* NOTE: The sum of all numbers will always be even.
* HINT: How is this problem similar to add()? How is it different?
Expand All @@ -74,7 +84,12 @@ function multiply() {}
* average(10, 6);
* //> 8 // 10 + 6 = 16; 16/2 = 8;
*/
function average() {}
function average(a,b) {
let average = 0
average = (a+b)/2
return average

}

/**
* averageThree()
Expand All @@ -93,7 +108,15 @@ function average() {}
* averageThree(10, 11, 19);
* //> 10 // 10 + 11 + 19 = 30; 30 / 3 = 10;
*/
function averageThree() {}
function averageThree(a,b,c) {

let average = (a+b+c)/3
return average
}


/********************************* VANDHANA MOHAN *******************************/


/**
* compareTypes()
Expand All @@ -112,7 +135,17 @@ function averageThree() {}
* compareTypes("left", 10);
* //> false
*/
function compareTypes() {}
function compareTypes(a,b) {

// this function returns true if same datatype

if (typeof a === typeof b){ // checking for same datatype, using typeof
return true
}
else{
return false
}
}

/**
* flipSign()
Expand All @@ -131,7 +164,13 @@ function compareTypes() {}
* flipSign(50);
* //> -50
*/
function flipSign() {}
function flipSign(a) {
// if (a < 0){ // multiplying the given number with -1, whether positive or negative will flip
// return (a * -1)
// }
// else if (a > 0){
return (a * -1)
}

/**
* joinStringsWithSpaces()
Expand All @@ -151,7 +190,12 @@ function flipSign() {}
* joinStringsWithSpaces("left", "right", "up", "down", "away");
* //> "left right up down away"
*/
function joinStringsWithSpaces() {}
function joinStringsWithSpaces(a,b,c,d,e) {
return `${a} ${b} ${c} ${d} ${e}` // concatenating all the strings into one string
//return a + " " + b + " " + c + " " + d + " " + e
}

/********************************* VANDHANA MOHAN *******************************/

/**
* getFirstAndLastCharacter()
Expand All @@ -168,7 +212,10 @@ function joinStringsWithSpaces() {}
* getFirstAndLastCharacter("upwards");
* //> "us"
*/
function getFirstAndLastCharacter() {}
function getFirstAndLastCharacter(a) {
return a.charAt(0) + a.charAt(a.length-1)

}

// Do not change the code below.
module.exports = {
Expand Down
75 changes: 65 additions & 10 deletions src/02-data-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
* getLengthOfString("down");
* //> 4
*/
function getLengthOfString(str) {}
function getLengthOfString(str) {
return str.length
}

/**
* convertToNumber()
Expand All @@ -22,7 +24,9 @@ function getLengthOfString(str) {}
* convertToNumber("111");
* //> 111
*/
function convertToNumber(val) {}
function convertToNumber(val) {
return Number(val)
}

/**
* convertToString()
Expand All @@ -36,7 +40,9 @@ function convertToNumber(val) {}
* convertToString(99);
* //> "99"
*/
function convertToString(val) {}
function convertToString(val) {
return val.toString()
}

/**
* convertToShoutingText()
Expand All @@ -49,7 +55,9 @@ function convertToString(val) {}
* convertToShoutingText("Hello There");
* //> "HELLO THERE"
*/
function convertToShoutingText(text) {}
function convertToShoutingText(text) {
return text.toUpperCase()
}

/**
* convertToWhisperText()
Expand All @@ -62,7 +70,9 @@ function convertToShoutingText(text) {}
* convertToWhisperText("Hello There");
* //> "hello there"
*/
function convertToWhisperText(text) {}
function convertToWhisperText(text) {
return text.toLowerCase()
}

/**
* checkIfCharacterIsInString()
Expand All @@ -79,7 +89,21 @@ function convertToWhisperText(text) {}
* checkIfCharacterIsInString("hello there", "a");
* //> false
*/
function checkIfCharacterIsInString(text, character) {}



/********************************* VANDHANA MOHAN *******************************/



function checkIfCharacterIsInString(text, character) {
if (text.includes(character)){ // checking if character is inside the text
return true
}
else{
return false
}
}

/**
* isEven()
Expand All @@ -95,7 +119,14 @@ function checkIfCharacterIsInString(text, character) {}
* isEven(11);
* //> false
*/
function isEven(num) {}
function isEven(num) { // checking if the number is even
if (num % 2 === 0){
return true
}
else{
return false
}
}

/**
* isOdd()
Expand All @@ -111,7 +142,20 @@ function isEven(num) {}
* isOdd(11);
* //> true
*/
function isOdd(num) {}
function isOdd(num) {
if (num % 2 !== 0){ // checking whether number is odd
return true
}
else {
return false
}
}



/********************************* VANDHANA MOHAN *******************************/



/**
* isTruthy()
Expand All @@ -127,7 +171,13 @@ function isOdd(num) {}
* isTruthy(null);
* //> false
*/
function isTruthy(val) {}
function isTruthy(val) {
if(val){
return true
}
return false
}


/**
* isFalsy()
Expand All @@ -143,7 +193,12 @@ function isTruthy(val) {}
* isFalsy(" ");
* //> false
*/
function isFalsy(val) {}
function isFalsy(val) {
if(!val){
return true
}
return false
}

// Do not change the code below.
module.exports = {
Expand Down
Loading