Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions MyPlayground day 4.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import UIKit
import Darwin
import Foundation
//task 1

var greeting = "Hello, playground"


class shape {
func arae () -> Int {
return 0
func voluma () -> Int {
return 1
}
}


}

class riangle {

func arae () -> Int {
return 2
func voluma () -> Int {
return 3
}
}
class square {
func arae () -> Int {
return 4
func voluma () -> Int {
return 5
}
}
//task 2

struct Book {
var title: String = ""
var auther: String = ""
var pages: Int = 0
var price: Double = 0.0

}




// task 3


var favoriteBook = Book()
print(favoriteBook.title)
favoriteBook.title = "cars world"
favoriteBook.auther = "mohammed"
favoriteBook.pages = "95"
favoriteBook>prive = "22.555"


//task 4


class elemnt{

var arr = [1,2,3,4,5,6]
var sum = 0
func max()-> Int {
return arr.max() ?? 0
func min()-> Int {
return arr.min() ?? 0



} }
}

//task 5

class disstance {
var inch : Int
var feet : Int
init(feet:Int,inch:Int) {
self.feet=feet
self.inch=inch
}
func distance () {
print(feet)
}
}
var aww = disstance(feet: 9, inch: 8)
}
}

4 changes: 4 additions & 0 deletions MyPlayground day 4.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios' buildActiveScheme='true' importAppTypes='true'>
<timeline fileName='timeline.xctimeline'/>
</playground>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MyPlayground day 4 (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>