0
Code coach error
Intermediate Java script Lesson 4 Code coach Its not moving, I am stuck, app still showing my code is wrong Or am I wrong I think app have some bugs function main() { var prodID = readLine(); var price = parseInt(readLine(),10); var discount = parseInt(readLine(),10); var prod1= new Product(prodID, price); console.log(prod1.prodID + " price: " + prod1.price); prod1.changePrice(discount); console.log(prod1.prodID + " new price: " + prod1.price); } function Product(prodID, price) { this.prodID = prodID; this.price = price; this.changePrice = function(discount) { this.price -= (this.price * discount) / 100; } }
3 Respuestas
+ 2
Rashid Rashi, you need to add a closing curly brace for the changePrice method.
0
Rashid Rashi ,
Please add a 'js' tag.
0
int sum = 0;
int num = 0;
while (num<=4){
sum+= num;
num++;
}
System.out.println(sum);
}
}
Where is my mistake