JS-Assignment-5

 1. Create Employee class and add properties name, age, basic and add getSalary method to its prototype. Create 5 Employee objects and print their salaries.


 2. Create Product class and add properties brand, price, model and add getDiscountPrice method to its prototype. Create 5 Products objects and print their discount price.

Note: For each object of these 5 , send different discount percentages as argument


Read the following articles:


https://www.w3schools.com/js/js_object_constructors.asp


https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes



Comments

Post a Comment

Popular posts from this blog