Generation

generate functionMon, 17 Apr 2023

Una empresa tiene el registro de las horas que trabaja diariamente un empleado durante la semana (seis días) y requiere determinar el total de éstas, así como el sueldo que recibirá por las horas trabajadas.

function workHours(hours) { var total = 0 for (var i = 0; i < hours.length; i++) { total += hours[i] } return total } function salary(hours, value) { return workHours(hours) * value } console.log( salary([8, 7, 6, 5, 4, 3], 40) )

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code