Develop in Swift...

Developing in Swift...

Turn Back to the Home Page

2.9.2024

Today I read the pages 0-46 from the book Develop in Swift AP CS Principles. This is my summary about Unit 1 Values: Computer programs and computers work with inputs and outputs. Input is the information that we type in to the computer for the computer to process and give us information. The information that the computer gives us are outputs. Outputs can be understood by our sense organs. The information that is put and taken out of the computer can be in different types. For example, if it contains numbers, it could be an integer, or if it contains text, it could be a string. The information that computers process could also be called data. Data is a large pack which consists of separate values. These values make up data, and then, the data can be processed for the computer to inspect the values individually and come up with a solution. Also, when typing in an input or when examining an output, specific naming and identifiers could be used. These elements would be used in a universal way which lets anyone understand what the input or output is about, what is the goal of the input, why was the input typed in this specific way, etc. For example, instead of writing a numerical formula which calculates how fast a pool would fill up using a sink that has a specific flow rate, we could write the equation and then write what each number stands for in a string. Another topic covered in the book is constants and variables. They are both types of values. While constants have a value that is stable and is always the same, values of variables could change. Using all the values, data, input, and outputs, computer programmers could build a simulation that works for a solution to a unique problem.

3.9.2024

Today I wrote my first code in Xcode that prints: Hello, Ata. Here is my code:

import UIKit
let greeting = "Hello "
let name = "Ata "
print("\(greeting)\(name)")

I also created a Photo Frame app from Xcode (Couldn't be loaded yet). Other than that, I took notes from the videos I watched from Collegeboard: The first topic is collaboration. Collaboration that includes diverse perspectives has a lot of benefits. Some of these benefits are, collaboration helps avoid bias, it helps produce a computing innovation, it reflects diversity, and it makes solving problems easier with a partner. While collaborating, consensus building, conflict resolution, negotiation, and communication skills are learned. Also, there are a few types of collaborating. Two of these that were also mentioned in the video are pair programming and think-pair-share. In the next chapter, computing innovations were explained. Also, while collaborating, comments are used to make the other side informed about the goal and function of each program statement. Some examples of computing innovations can be cell phones, social media, and cloud services. These are innovations that all work to solve a unique problem using programming. Also, the input can come from some person or from some website. If the input differentiates, the output can also differentiate. Inputs can be tactile, visual, with a click or a text, and audial. When an input is entered, the program triggers the related code segment; it doesn't run the whole code. Also, programs are made of code segments that are made of program statements (lines of code). While designing a program, investigating is always important. Developers also must determine the requirements of the desired program, understand the constraints of it, and also understand the user interests. When developers develop a website, they brainstorm, storyboard, plan user experience, layout user interface, organize in modules, and develop a testing strategy. This means that a development process can be ordered. Lastly, credits should be given to the person who wrote the code that the developer got from somewhere else and used in their own code. Every single person who has even a very small benefit to the program should be credited.

4.9.2024

Today I wrote an algorithm that tells you what to wear when going out according to the weather. I also watched the videos 1.4. The first video explains types of errors. A logic error is a coding error in the algorithm that causes the program to behave unexpectedly. A syntax error is an error that is present when a typo is made, a parenthesis or a bracket is forgotten, and other mistakes that don't obey the rules of the language. A runtime error is an error that occurs whilst the program is running. It may happen because a float is entered while a string is expected and other occasions like this. An overflow error is an error that happens because the program tends to exceed the memory limit of the device it is coded in. I also started to code my scratch Connect4 game from a tutorial that I found from the internet.

5.9.2024

Today I finished Coding jobs one, two, three, and four. I uploaded them to a GitHub repository. I also practiced my Swift knowledge by writing more code in Playgrounds. In order to access my Swift codes please click the link that would take you to the GitHub repository that contains my codes.

6.9.2024

Today, I finished videos 2.1. The first video explains binary code. Binary includes two numbers, a 1 and a 0. 1 represents on and 0 represents off. Binary digit is a bit, and a bit is the smallest unit of data in computing. 8 bits add up to a byte. The digits 1 and 0 mean an electrical signal being on and off. These signals tell the computer what to do. Binary code can stand for almost anything. Text, images, sound, etc. All these details are hidden for the user to focus on the main task. Only essential parts of the computer are used visually, and this is called abstraction. In the next video, it talks about consequences of using bits. For example, integers are represented by a fixed number of bits, so there is a limit to the integers that could be displayed. This is also an overflow error. Computers also encounter round-off errors when displaying real numbers like pi. The last video talks about number systems. While normally number systems are like 1000, 100, 10, 1, in binary, the number system is like 8, 4, 2, 1. We could keep doubling the value. I also filmed a video of my presentation of what I understood of Big Idea 1. video page video repository

14.9.2024

Today I watched the videos of Big Idea 2. The main things I learned are that compression decreases the bits that are used to store data. It is used to save transmission time. In text compression, the same characters might be saved as a shorter set of bits that would be used instead of that character. When compressing images, the same colored pixels might appear as duplicated pixels of the same colored pixels. These examples were about lossless compression. In contrast, lossy compression removes some data permanently to reduce file size even more. For example, in a lossy compressed image, some details may be lost, reducing the quality. But this helps in storing larger files with smaller sizes.