+ 3

Separate "Trip Planner" answers?

There are two questions/codes to fill out for the Trip Planner exercise. I can correctly answer each exercise separately/one at a time, but can't figure out how to answer both exercises at once (which seems to be required for the exercise to be marked as complete.) Entering code for both exercises enters the numbers together as a single wrong answer. I'm probably just dumb and completely missing something simple but can someone please tell me what I'm doing wrong? Code used: //#1 answer in 590 out 885 var hrs=590/40; var mins=hrs*60; console.log(mins); //#2 answer in 100 out 150 var hrs=100/40; var mins=hrs*60; console.log(mins); }

30th Oct 2021, 5:28 PM
Haswari
3 Réponses
0
You have to write one general code that works for multiple test cases -- known ones and unknown ones. You are directly putting in the numbers. Instead you have to take input and work with that.
30th Oct 2021, 7:44 PM
Simon Sauter
Simon Sauter - avatar
0
korom
22nd Sep 2022, 1:28 PM
Langat
0
write distance instead of putting values like 590 and 100.
1st Oct 2022, 1:51 PM
Sehrish Zahra
Sehrish Zahra - avatar