IFSC 3300 Web Client Applications

Shorter HW 15 (worth up to 50 pts.)

Due Wednesday, Dec. 7, 2022 at 11:59 p.m. instead of a final exam. Please email the answers to IFSC3300HW@gmail.com.

 

1. Declare an object with at least 4 properties and a method. Print the values of the properties, the value of the method (which looks like source code because a method is a property, a property whose value is code instead of a number, a boolean, a string or whatever), and the result of running the method (i.e. its returned value).

2. Declare a constructor function (which by convention starts with a capital letter). Make it able to create objects with the same properties and method as above. Create three of the objects. Print the property values, method code, and method return value of one of the objects.

If 1,000 objects needed to be created (as elements of an array, for example), using a constructor function is a lot better than trying to declare each object individually!

3. Declare a class that does the same thing as the constructor function above. Make an object from the class. Print out the property values, method code, and method return value of the object.