//: Playground - noun: a place where people can play

import UIKit

//var salary1 = 1000
//var salary2 = 2000
//var salary3 = 1700
//var salary4 = 1800
//var salary5 = 1200
//
//let taxrate = 20
//
//salary1 -= taxrate * salary1 / 100
//salary2 = salary2 - taxrate * salary2 / 100
//salary3 -= taxrate * salary3 / 100
//salary4 -= taxrate * salary4 / 100
//salary5 -= taxrate * salary5 / 100


// empty array
var array1 = [Int] ()

// count , initial value
var array2 = [Int](repeating : 500, count : 5)

// access to element
print("The first element of array is \(array2[0])")

//
//var someInts = [12, 14, 18, 19, "Mohammad"] as [Any]

var someInts : [Int] = [13, 17, 19]

someInts.count
someInts.append(21)
someInts.append(19)
someInts.append(18)

someInts.count

someInts.remove(at: 2)

print(someInts)

someInts.remove(at: 2)

print(someInts)

someInts.removeAll()
print("someInts = \(someInts) and count = \(someInts.count)")

var someData : [Int] = [19, 13, 10, 4]

print(someData)

someData.removeAll(keepingCapacity: true)

someData.count

someData.capacity
someInts.capacity

someInts.isEmpty
someData.isEmpty

var arrA : [Int] = [12, 18, 20]
var arrB : [Int] = [14, 19]

var arrC : [Int] = arrA + arrB
print(arrC)

arrC += [5, 6, 9, 10]
print(arrC)


