From c0f14ec429a8cbf4b7ce68ab90a105c509fb1c01 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Tue, 15 Jan 2019 11:07:04 +0300 Subject: [PATCH] completed 4 of 5 problems --- HomeWork.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 HomeWork.txt diff --git a/HomeWork.txt b/HomeWork.txt new file mode 100644 index 0000000..1745c27 --- /dev/null +++ b/HomeWork.txt @@ -0,0 +1,68 @@ +Problem 1 + + + + +problem 2: + +var currYear = 2019; +var BYear = 1994; +var totalAge = currYear - BYear + +console.log ( "Your old is " + totalAge + " or " + (totalAge - 1) + "!!"); + +output : +Your old is 25 or 24!! + +problem 3 : + +var currAge = 25; +var maxAge = 90; +var amountPerDay = 3; +var total = maxAge - currAge; +var totalAmount = total * amountPerDay; + +console.log ("You will need " + totalAmount + " to last you until the ripe old age of " + maxAge ); + +out put : +You will need 195 to last you until the ripe old age of 90 + + +problem 4: + +part 1: + +var radius = 5; +var circumference = 2 * radius * 3.14; + +console.log("The circumference is " + circumference ); + +output : +The circumference is 31.400000000000002 + + +part 2: + +var radius = 5; +var area = (5 * 5) * 3.14; + +console.log("The area is " + area ); + +output: +The area is 78.5 + + +problem 5 : + +var celsius = 10; +var fahrenheit = 50; + +var conToFahrenheit = (celsius * 9/5) + 32; +var conToCelsius = ( fahrenheit - 32 ) * 9/5; +console.log( celsius + "C is " + conToFahrenheit +"F"); +console.log( fahrenheit +"F is " + conToCelsius +"C"); + +output : + +10C is 50F +50F is 32.4C \ No newline at end of file