Selection

This page is under construction. Please come back later.
#!/usr/bin/env swift;
import Foundation
func main() -> Void {
print("Start...")
if CommandLine.arguments.count != 3 {
print("You need at least two command line arguments!")
}
print("Finish...")
exit(EXIT_SUCCESS)
}
main()
Output
Start...
You need at least two command line arguments!
Finish...
Start...
Finish...
#!/usr/bin/env swift;
import Foundation
import Utils
func main() -> Void {
let x:Int = Int(CommandLine.arguments[1]) ?? 0
print("Start...")
if x > 10 {
print("Greater than 10")
} else {
print("Less than or equal to 10")
}
print("Finish...")
exit(EXIT_SUCCESS)
}
main()
Output
Start...
Less than or equal to 10
Finish...
Start...
Greater than 10
Finish...
#!/usr/bin/env swift;
import Foundation
import Utils
func main() -> Void {
let x:Int = Int(CommandLine.arguments[1]) ?? 0
print("Start...")
if x > 1000 {
print("Greater than 1000")
} else if x > 100 {
print("Greater than 100 but less than or equal to 1000")
} else {
print("Less than or equal to 100")
}
print("Finish...")
exit(EXIT_SUCCESS)
}
main()
Output
Start...
Less than or equal to 100
Finish...
Start...
Greater than 100 but less than or equal to 1000
Finish...
Start...
Greater than 1000
Finish...
Error 500 - Internal server error Error 500 - Internal server error
An internal server error has occured!
Please try again later.
Output
Error 500 - Internal server error
An internal server error has occured!
Please try again later.
Error 500 - Internal server error Error 500 - Internal server error
An internal server error has occured!
Please try again later.
Output
Error 500 - Internal server error
An internal server error has occured!
Please try again later.
Questions
- {{Who's on first?}}
- {{Who's on second?}}
- {{Who's on third?}}
Projects
More ★'s indicate higher difficulty level.
- FICA Taxes (Revisited)
- FICA Taxes (Empoyee and Employer)
- Football Passer Rating (NFL and NCAA)
- Income Tax (Single Taxpayer)
- Income Tax
- Pythagorean Theorem
- Retirement Calculator
References
- [[Swift Community]]
- [[Swift Language Guide]]
- [[Swift Language Reference]]
- [[Swift Programming Language]], Apple Inc.
- [[Swift Doc]]
- [[We Heart Swift]]
- [[Swift Cookbook]]
- [[Swift Playground]]
- [[Swift at TutorialsPoint]]
- [[Hacking with Swift]]
Pure Programmer


