Skip to content

Commit 2c4d2f7

Browse files
authored
Add files via upload
1 parent 01b3d0c commit 2c4d2f7

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Date: Sept 6, 2024
2+
// Written by Mason Z.
3+
4+
5+
// swift constant array containing inferred strings
6+
let languages = ["Swift", "Java", "Javascript", "C++"]
7+
8+
// swift basic for-loop
9+
for language in languages {
10+
print(language)
11+
}
12+
13+
// swift number loop fill in
14+
var end = 4
15+
var value = 1...3
16+
17+
for i in 1...end {
18+
print(i);
19+
}

Basic Swift Concepts/info.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Basic Swift Concepts
2+
Swift concepts/mechanic examples.
3+
4+
Written in order to understand basic swift. Coded + Compiled on
5+
[Programiz](https://www.programiz.com/swift/online-compiler/)
6+
7+
2024 - 2025 Computer Science Seminar (2024 Section)
8+
In relation with Swift Practice + Warmups.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// declare a variable named base of type Int
2+
print("base?")
3+
let base: Int = Int(readLine()!)!
4+
5+
// do the same thing with height
6+
print("height?")
7+
let height: Int = Int(readLine()!)!
8+
9+
// declare a constant named area and set it equal to 1/2 base * height
10+
11+
let area: Double = 0.5 * Double(base*height)
12+
13+
// print out a sentence
14+
15+
print("The area of a triangle with a base = \(base) and a height = \(height) is \(area)")

Swift Practice + Warmups/info.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Swift Practice + Warmups
2+
Swift practice/Warmups from class.
3+
4+
Written to practice Swift freely/apart of class. Coded + Compiled on
5+
[Programiz](https://www.programiz.com/swift/online-compiler/)
6+
7+
2024 - 2025 Computer Science Seminar (2024 Section)
8+
In relation with Basic Swift Concepts.

0 commit comments

Comments
 (0)