Internal Code: MAS6932
IT Assignment:
Questions:
1) Define the following terms
a. Private variable:
b. Public variable:
c. Protected variable:
2) What is a child class?
3) Define the following terms with regard to programming
a. Stack:
b. Queue
c. ArrayList:
4. Write a console application to create a class named Rectangle to represent a rectangle. The class contains:
a) Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.
b) A constructor that creates a rectangle with the specified width and height.
c) Getters and Setters (Properties) for all the data fields.
d) A method named Area() that returns the area of this rectangle.
Finally, create two Rectangle objects and assign width 4 and height 40 to the first object and width 3.5 and height 35.9 to the second object. Display the properties of both objects and find their areas.
5. Write a console application to create a Books class with Title, Author and ISBN, Price and Quantity as the properties. Now create a Book Library as an ArrayList with 5 items. Insert five items to the library and display the details of the books in the library and the total number of book in the library
6) 6. Write a console application using a HashTable, which reads the numerical characters and dashes of the anISBN number and displays the number in words. For example, if the user enters “0-672- 32740-6” the output should be “Zero Dash Six Seven Two Dash Three Two Seven Four Zero Dash Zero”.