Skip to content

JawaherHassan2/day4-lab1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Day4 Lab1: Enitiy 1

Topics

  1. Abstraction
  2. Classes
  3. Structs
  4. Properties
  5. Initialization
  6. Comparing Values Type and Reference Types
  7. Protocols
  8. Inheritance

Description

  1. 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 draw () and erase (). Create these using polymorphism concepts.

  2. 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 ann empty sting, pages should be defualt to 0, and price should be default to 0.0

  3. 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

DeadLine

Wednesday 29 September

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%