Java script | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java script

Time to go shopping! Everything in the store has been discounted by 20%. You are given a program that takes the price of an item as input. Complete the program so that it outputs the discounted price to the console. Sample Input 100 Sample Output 80 Explanation 20 percent of 100 equals to 20 (100 * 20/100), so the discounted price will be 80 (100 - 20).

4th May 2021, 10:36 AM
Kebiru Idakwo
Kebiru Idakwo - avatar
15 Answers
+ 2
how can you see and open this task?
4th May 2021, 11:15 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Hi! For better help to you, please, show us your code attempt! Thx!
4th May 2021, 10:44 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Function main(){ Var oldprice=parseint (deadline,()10); Var total=80/100*oldprice; Console.log(total)}
4th May 2021, 10:48 AM
Kebiru Idakwo
Kebiru Idakwo - avatar
+ 1
may I ask where you got this task from?
4th May 2021, 10:58 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
4th May 2021, 1:54 PM
Atul [Inactive]
0
From one of the challenges in javascript section
4th May 2021, 11:03 AM
Kebiru Idakwo
Kebiru Idakwo - avatar
0
Kebiru Idakwo It is just a 5th standard math problem. You have to get 20% discounted amount so if you have 100 then 20% discounted amount will be 80 If you have 200 then discounted amount will be (200 - 200 * 20 / 100) = 160 If you have 150 then it would be (150 - 150 * 20 / 100) = 120 So just do this price - (price * 20 / 100)
4th May 2021, 11:04 AM
A͢J
A͢J - avatar
0
could you provide a link to this task? and I have doubts that you wrote the program. it contains a lot of mistakes, if you want to learn how to solve it, then you should go back and get trained from the moment where you got something unclear. don't be afraid to ask substantive questions
4th May 2021, 11:10 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Why people get problem in this type of challenge even Explanation is very clear.
4th May 2021, 11:11 AM
A͢J
A͢J - avatar
0
because this person did not try to solve it on their own, did you check the code given to them for performance?
4th May 2021, 11:12 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Lesson 7.1 / practice 7.2
4th May 2021, 11:14 AM
Kebiru Idakwo
Kebiru Idakwo - avatar
0
I'm new to javascript,I'm learning as a beginner! With time, everything will be fine
4th May 2021, 11:20 AM
Kebiru Idakwo
Kebiru Idakwo - avatar
0
most likely, you didn't write the code. you got it somewhere. if you see that the task is too much for you, go back to the place in the training where you understood everything. go through your lessons again
4th May 2021, 11:22 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Kebiru Idakwo, I understand what are you trying to ask(if I'm right), did you get that before finishing one section in javascript, but it's in the last? I encountered that when using sololearn in web, I think it's not for you right now to answer, it's node.js? Right? Or not?
6th May 2021, 3:42 AM
Jonathan P. Jundarino
Jonathan P. Jundarino - avatar
0
Thanks Atul
6th May 2021, 6:36 AM
Kebiru Idakwo
Kebiru Idakwo - avatar