You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Task a: declare a variable called votingAge, console log true if age > 18 (no function required)
var votingAge = "true";
true > 18;
console.log(votingAge);
//Task b: declare a variable and then use a conditional to change the value of that variable based on the value assigned to a second variable (no function required)
var nameSchool = 'Lambda School';
nameSchool = 'Full Stalk Web';
console.log(nameSchool);
//Task c: Convert string ("1999") to integer (1999) (no function required) // hint look up the Number method
var a ="15.87"; //This is a string.
var resultInt = Math.floor(a); //This outputs integer.
// when you are finished invoke your function with the weight of 15 lbs and the age of 1 year - if your calculations are correct your result should be 0.44999999999999996
//a. KM to Miles - should take the number of kilometers and convert it to the equal number of miles
let kilotoMile = 0.62137119;
function multiply(a,kilotoMile){
return a * kilotoMile;
}
console.log(multiply(2,kilotoMile));
//b. Feet to CM - should take the number of feet and convert it to the equal number of centimeters
let feettoCm = 30.48;
function multiply(a,feettoCm){
return a * feettoCm;
}
console.log(multiply(2,feettoCm));
Expand All
@@ -82,8 +144,12 @@
// create a function called annoyingSong
// the function should take a starting number as an argument and count down - at each iteration it should log (number) bottles of soda on the wall, (number) bottles of soda, take one down pass it around (number left over) bottles of soda on the wall`
function annoyingSong(){
for(let i = 0; i <= 99; i--){
let annoyingSong = """ + "bottle of soda on the wall" + "" "bottles of soda" + "take one down pass it around" + "" "
task 4 complete #1
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
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
task 4 complete #1
Changes from all commits
074da6f273af38c80a681File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing