+ 1
Can anyone help me to solve this js project??
Trip Planner you need to plan a road trip. You are traveling at an average speed of 40 miles an hour. Given a distance in miles as input (the code to take input is already present), output to the console the time it will take you to cover it in minutes. Sample Input: 150 Sample Output: 225
14 Respostas
+ 2
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
var miles = 40;
var minutes = distance / miles;
console.log(distance / 40 * 60);
}
+ 1
Ok. ThanksЯрослав Вернигора(Yaroslav Vernigora)
0
Hi! have you tried to solve this problem yourself? can I see your code? this will help a lot in the solution
0
I have understood the question. But Don't know how to solve ♤♢☞ 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 ☜♢♤
0
what are your thoughts on this? share them
0
I have tried.here it is.
//this project is given by sololearn
/*function main() {
var distance = parseInt(readLine(), 10);
*/
//your code goes here
function main() {
var x =parseInt(document.getElementById('input').value);
var distance=(x/40)*60;
return distance ;
document.getElementById('output').innerHTML=distance;
}
// i write this. But i have been told that, i have to show the result at console panel.
Ярослав Вернигора(Yaroslav Vernigora)
0
all right. why are you making this so difficult? we made a decision in the form of a function. this is unnecessary. drop the function, use the formula... and what command is called by the console?
0
I am newcomer in programming language. That's why I didn’t realise that it had become so complicated.
This is the command >output to the console the time it will take you to cover it in minutes.
Ярослав Вернигора(Yaroslav Vernigora)
0
try to use console.log() for output. In other cases use document.write()
0
you are using the formula correctly. remove the function. this is unnecessary. you can create only one variable (for example, dist_rezult), where you will write the conversion result. you will take the initial value from the distance variable. then use the console call command to output this result (dist_rezult)
0
in python all you need to do is:
a=int(input( ))
print(a*60/40)
0
got it. Thanks Ahmed Mohammed Alnor Abdalmahmod Abdalslam
0
Look at my code above
0
I want the solition for words project please can any one share that