Skip to content
Open
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
24 changes: 16 additions & 8 deletions pset1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ if that number is > 100, should return NaN
if invalid input given, return -1
******************/

function myAge( ageNow, numYears ) {

}
function myAge(ageNow, numYears) {

return ageNow + numYears

}

console.log(myAge(34, 60))

/******************
Concatenate Strings
Expand All @@ -23,17 +25,19 @@ Concatenating string variables
- Create a function called myConcatenate that takes 3 arguments
* Create an argument called firstStr
* Create a second argument called secondStr
* Create a third argument called thridStr
* Create a third argument called thridxStr
- Concatenate all three arguments in a variable called mySentence
* console out mySentence variable
- Call myConcatenate function
******************/

function myConcatenate( firstStr, secondStr, thirdStr ) {

return firstStr + secondStr + thirdStr
}

myConcatenate('I', 'am', 'iron man'); // 'I am iron man'

console.log(myConcatenate('I', ' am', ' iron man')); // 'I am iron man'

/******************
Subtract Function
Expand All @@ -45,9 +49,12 @@ Ensure that both of the inputs are numbers
******************/

function subtract(a,b) {


return a - b
}

console.log(subtract(3,5))

/******************
Area of A Circle

Expand All @@ -62,9 +69,9 @@ A = π * r2, where is π is Pi and r is the radius squared

function areaOfaCircle(radius){


return 3.14 * (radius * 2)
}

console.log(areaOfaCircle(8))
/******************
Temperature Converter Fahrenheit to Celsius

Expand All @@ -76,6 +83,7 @@ Convert it to celsius and output "NN°F is NN°C."
******************/



/******************
Temperature Converter Celsius to Fahrenheit

Expand Down