+ 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. ???
1 Antwort
0
Your not using your input in the calculation,,,
Shouldn't it be something like:...Let y = oldPrice - (0.2 *oldPrice);