Find errors | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
18th Oct 2020, 1:49 PM
Sahil Chib
Sahil Chib - avatar
10 Respostas
+ 3
Sahil Chib ok now I try to resolve it šŸ‘ŒšŸ»
18th Oct 2020, 2:15 PM
Matthew
Matthew - avatar
+ 3
Sahil Chib i think we must create an convert in number function... šŸ¤”If I have the solution I send it to you šŸ™‚
18th Oct 2020, 2:20 PM
Matthew
Matthew - avatar
+ 2
You can try this: var priceOfBreakfast; var priceOfLunch; var priceOfDinner; //Gather User Input priceOfBreakfast = prompt ("Enter price Of Breakfast") ; Breakfast = parseInt ("Breakfast") ; priceOfLunch = prompt ("Enter price Of Lunch") ; Lunch = parseInt ("Lunch") ; priceOfDinner = prompt ("Enter price Of Dinner") ; Dinner = parseInt("Dinner") ; var num1 = parseInt(priceOfBreakfast ); var num2 = parseInt(priceOfLunch); var num3 = parseInt(priceOfDinner); //Process or compute the result var totalAmount = num1+num2+num3; //Output Result document.write(totalAmount) ; I hope I helped you šŸ˜„ Happy coding šŸ™‚ ā˜ŗļø
18th Oct 2020, 2:07 PM
Matthew
Matthew - avatar
18th Oct 2020, 2:16 PM
Sahil Chib
Sahil Chib - avatar
18th Oct 2020, 2:11 PM
Sahil Chib
Sahil Chib - avatar
+ 1
šŸ…¶šŸ…»šŸ…øšŸ†šŸ…° if I add 3+2+3 output is 323
18th Oct 2020, 2:12 PM
Sahil Chib
Sahil Chib - avatar
+ 1
šŸ…¶šŸ…»šŸ…øšŸ†šŸ…° please check and let me know what to fix
18th Oct 2020, 2:12 PM
Sahil Chib
Sahil Chib - avatar
+ 1
Also, if there is a dollar sign before the price in the prompt, the result would be ā€˜NaNā€™.
19th Oct 2020, 4:43 AM
thetechguy
thetechguy - avatar
+ 1
What does "Breakfast = parseInt("Breakfast");" do?
19th Oct 2020, 11:34 PM
Mind To Machine šŸ’»šŸ•†
Mind To Machine šŸ’»šŸ•† - avatar
+ 1
https://code.sololearn.com/W8Kj7McK4iIe/?ref=app you do not write closing body tag and you write body tag under the head tag see this code and solve it
20th Oct 2020, 11:51 AM
Hriday Kalita