Created
June 27, 2021 22:06
-
-
Save barron9/cc1327e55a709432af3c2f0b515d2dd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class test{ | |
//takes package parent class | |
init(package: Package,price :Int64) { | |
do{ | |
try 8 * 100/package.setPrice(price:price) | |
print("done") | |
}catch { | |
print("price value must be greater than 0 _ \(price) ") | |
} | |
} | |
} | |
test(package: Package(),price: 10) //no issues | |
test(package: Pro(),price: 999) //error //strentened pre conds | |
test(package: Basic(),price: 999) //error //strentened pre conds | |
test(package: Basic(),price: 999) //error //weakened post condition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment