diff --git a/index.js b/index.js index bdafe4c8b..c658060ba 100644 --- a/index.js +++ b/index.js @@ -34,16 +34,21 @@ function addNumbers(num1, num2) { * passing 'Andy' as the argument, * the returned value should look like: 'Goodbye, Andy. Have a great day.' * -*/ -function sayGoodbye(/* code here */) { - /* code here */ -} + */ +// let name = Chandra; +// function sayGoodbye(name) { + +// return `Goodbye, ${name}. Have a great day.`; + +// console.log(sayGoodbye); + +// } /** * ### Challenge `temperatureCtoF` * * @instructions - * This function should take an a temperature in celsius as an argument, + * This function should take a temperature in celsius as an argument, * and return the temperature in fahrenheit, rounded to the nearest whole number. * * For example, if we invoke `temperatureCtoF` @@ -53,12 +58,19 @@ function sayGoodbye(/* code here */) { * Hint 1: The formula for converting celsius to fahrenheit is t*9/5 + 32 where t is the temperature in celsius. * Hint 2: There is a very easy way to round numbers in JS. Do a google search to find out how. */ -function temperatureCtoF(/* code here */) { +function temperatureCtoF(t === celsiusToFarenheit) { /* code here */ + const t = celsius; + const celsiusToFahrenheit = Math.round(t * 9/5 + 32); + const message = "${t} degrees celsius equals ${celsiusToFarenheit} farenheit."; + return message; + + console.log(message); } /** * ### Challenge `temperatureInF` + * * * @instructions * This function should take an a temperature and a unit (either 'F' or 'C') as arguments, diff --git a/package-lock.json b/package-lock.json index f3c02e373..170f2eb73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,9 +35,9 @@ } }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { @@ -2815,9 +2815,9 @@ } }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "lcid": { @@ -3167,11 +3167,18 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + } } }, "mocha": { @@ -3202,6 +3209,16 @@ "yargs": "13.3.0", "yargs-parser": "13.1.1", "yargs-unparser": "1.6.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + } } }, "mocha-junit-reporter": {