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).
15 Antworten
+ 2
how can you see and open this task?
+ 1
Hi! For better help to you, please, show us your code attempt! Thx!
+ 1
Function main(){
Var oldprice=parseint (deadline,()10);
Var total=80/100*oldprice;
Console.log(total)}
+ 1
may I ask where you got this task from?
+ 1
https://www.sololearn.com/Discuss/2774578/?ref=app
Please delete this question
0
From one of the challenges in javascript section
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)
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
0
Why people get problem in this type of challenge even Explanation is very clear.
0
because this person did not try to solve it on their own, did you check the code given to them for performance?
0
Lesson 7.1 / practice 7.2
0
I'm new to javascript,I'm learning as a beginner! With time, everything will be fine
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
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?
0
Thanks Atul