- Abstraction
- Classes
- Structs
- Properties
- Initialization
- Comparing Values Type and Reference Types
- Protocols
- Inheritance
-
Task 1: Write a program to create a class named shape. In this class we have three sub classes circle, triangle and square each class has two member function named Area () and volume (). create object of the circle class to return the the area and volume of the circle, create object of the triangle class to return the the area and volume of the triangle, create object of the sequare class to return the the area and volume of the sequare
-
Task 2: Imagine you are making a social app for sharing your favorite books. Create a Book struct with four variable properties: title, auther, pages and price. The default values for both title and auther should be an empty string, pages should be defualt to 0, and price should be default to 0.0
-
Task 3: Create a variable instance of Book called favoriteBook without supplying any arguments. Print out the title of the favoriteBook. Does it currently reflect the title of your favorite book? propapbly not, Change all four proproties of favoriteBook to reflect your favorite book. Then using the proprities of favorite book, print out facts about the book
-
Task 4: Write a program to create a class that has array of 6 elements. Then, return the sum of the elements in the array, the maximum, minimum value of the array.
-
Task 5: Create a class called distance that has a separate integer member data for feet and inches. One constructor should initilize this data to zero and another should initilize it to fixed values. A member function should display it in feet onches format.
Wednesday 29 September