7.2 Practice Big Sale SOS (Newbie - Be Nice please)
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 //so we donât overwhelm you, weâve hidden the code that executes the input function main() { var oldPrice = parseInt(readLine(), 10) //your code goes here } ^That is the problem and I am also stuck... I tried like this: function main(){ var oldPrice = parseInt(readLine(),10) var percentage= (oldPrice*20/100); var oldPrice=100; var newPrice =oldPrice - percentage; console.log(newPrice); ^It worked for 1 case but ask for at least 2 more dif input and outputs (that was not in the question and also has 2 more "secret" answers).So I wondered if there is a way to make this var oldPrice has different values, I tried to give different values after the console.log and tested if the value changed but broke the code hahaha So please đ