Начало
Калькуляторы
Коллективная работа
Когда-либо должен был работать с другим человеком, чтобы закончить задачу? Этот калькулятор скажет Вам, сколько времени потребовалось бы двум людям.
Person one can do the job in
hours.
Person two can do the same job in
hours.
Together, they can do the job in
hours.
JavaScript Calculators: коллективная работа
<!-- TWO STEPS TO INSTALL GROUP WORK: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin function groupWork() { person1 = parseInt(document.workform.person1.value); person2 = parseInt(document.workform.person2.value); worktime = (person1*person2)/(person1+person2); document.workform.time.value = worktime; } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <center> <form name=workform> Person one can do the job in <input type=text name=person1 size=5> hours.<br> Person two can do the same job in <input type=text name=person2 size=5> hours.<br> Together, they can do the job in <input type=text name=time size=10> hours.<br><br> <input type=button value="Solve!" name=solve onClick="groupWork()"><br> </form> </center> <!-- Script Size: 1.15 KB -->