Help me pls. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help me pls.

Help! I don't understand the task. Mathematical Operators. Prices for all goods in the store have been reduced by 20%. You are given a program that accepts the prices of the goods as introductory data. Complement the program so that the discounted price is displayed in the console. Example of input data 100 Example output 80. } Function main() { Let oldPrice = parseInt(readLine(), 10) Let y = 100 - (0.2 * 100); Console.log (y); } Here's the solution. But sololearn has 5 such tests, and there should be 5 answers, too. The question is how do I fit all 5 answers in one code so that the program understands that I'm answering the trail. Tests. ???

7th Dec 2020, 7:26 PM
Артем Шатило
1 Answer
0
Your not using your input in the calculation,,, Shouldn't it be something like:...Let y = oldPrice - (0.2 *oldPrice);
7th Dec 2020, 8:48 PM
rodwynnejones
rodwynnejones - avatar