-
We are looking to re-sod our lawn. It has a length of 25' and a width of 30', with Sod costing $1.45/sqft. Additionally, it will cost $180 to have the work done. Write a function that finds the area of the lawn, the price of the Sod needed, and what the total cost will be to get the lawn redone. Our budget is $1,100; set a conditional that sees if the cost is higher or lower than our budget, and by how much either way.
-
Overtime Calculator: A local business pays $25/hr for the first 40 hours worked each week, and time-and-a-half for each hour worked after that. Using your conditionals and mathematic operators, create a function that tells us how much someone would make if they worked 35hrs in a week, and how much if they worked 45hrs.
-
Century From Year: the first century goes from the year 1 to the year 99, the 19th century went from the year 1801 to 1900, and the 20th century strecthed from 1901 to the year 2000. Using our Math functions, write a function that takes a year as an argument, and logs which century it is in
-
Palindrome tester! Create a function that accepts a string as an argument. Using our String Methods and Conditonals, create a function to test whether or not the string is a Palindrome. After that - 'Go hang a salami, Im a lasagna hog'
-
Write a function that loops over the following array of SEI students and prints out their name, and how many letters their name is, as long as the name is 4 or more letters long. (you can copy this array into your code, don't worry about re-writing it)
const students = [
'Alice',
'Andrew',
'Bartholemew',
'Casey',
'Damian',
'Grant',
'Howie',
'Wade',
'Kat',
'Kim',
'Kiu',
'Natasha',
'Obi',
'Pedro',
'Sarah',
'Scott',
'Tiffany',
'Zhe'
]
It should give us "Alice is 5 letters long"... and so on
-
E-Commerce Mock-up : Create an array of objects for sale in an e-commerce site. Each object should have a property of name, price, whether the item is in stock or not, and a rating of 1-5. Then create a function that will loop through this array and only log the items that are instock, with either a price lower than, and a rating higher than, two values that you pass in as arguments.
-
A Realtor has contracted you to find the mean value of houses in an area. The values are as follows. Create a function that finds the average, and is versatile enough to perform the task if any houses are added, or removed to the data.
const houseValues = [800000, 750000, 1200000, 675000, 1000000, 880000, 1300500, 975000, 780000, 1305000, 9000000]