Please Convert The Python Code To Java Script Code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please Convert The Python Code To Java Script Code

x=int(input("Enter the total number of people: ")) def publicBusFare(x): a=(x//50) b=(x-a*50)//11 c=(x-a*50-b*11) pbf=c*250 print(pbf) publicBusFare(x)

11th Aug 2022, 5:27 PM
SRD
1 Answer
+ 3
// JS function publicBusFare(x) { let a = Math.floor(x/50); let b = Math.floor((x-a*50)/11); let c = x-a*50-b*11; let pbf = c*250; document.write(pbf); console.log(pbf); } window.onload = () => { var distance = prompt("Enter the total number of people: ", "0"); publicBusFare(Number(distance)); }
11th Aug 2022, 7:03 PM
SoloProg
SoloProg - avatar