# Final Project AP Computer Science Principles

I created a questionnaire asking people if they thought my would be useful these are the responses (link to these images are below blog had an error when I dragged images in).

As you can see by my survey results there is a problem with people being organised.

List of what my client wants:

Flowchart:

Testing Document:

Video Explaining my code and showing how my app works:

I can’t put comments into my code since I am using app inventor and app inventor doesn’t allow you to put in comments so I walk the view through the code in this video.

Challenges I faced and how I overcame them:

It was hard to incorporate the timer I used many different functions app inventor has to offer such as a list picker, time picker and a tiny db. However I did further research and found out about the clock function. I was able to incorporate the clock function into my code as the timer.

How I achieved Success:

I was able to accomplish what my client wanted. My code has a to do list feature where you can check things off. It alerts the user when a task has taken too long. I even put a timer so it tells the user how long they have been working on the task.

What I can improve on:

I think making my app more ascetically pleasing adding images and such. Maybe making buttons a certain colour would also make the code more ascetically pleasing.

# APCSP Sorting Algorithms

For my sorting algorithms my partner and I choose bubble sort and cocktail sort.

Cocktail sort video:

Cocktail sort explained by me in this video

I did research for cocktail sort. Cocktail sort is similar to bubble sort the difference between the two is that once cocktail sort has made its first round of left to right is goes back and goes from right to left. This means that cocktail search is more efficient than bubble sort and can get items sorted faster by using this technique.

Bubble sort video

Bubble sort explained int his video by my partner, one of the most simple ways of sorting but inefficient when compared to other sorting methods.

Citations:

“Bubble Sort.” GeeksforGeeks, 22 Jan. 2018, www.geeksforgeeks.org/bubble-sort/.

“5.7. The Bubble Sort¶.” 5.7. The Bubble Sort – Problem Solving with Algorithms and Data Structures, interactivepython.org/runestone/static/pythonds/SortSearch/TheBubbleSort.html.

“Cocktail Sort.” GeeksforGeeks, 26 June 2016, www.geeksforgeeks.org/cocktail-sort/.

“Sorting Algorithms/Cocktail Sort.” Sorting Algorithms/Cocktail Sort – Rosetta Code, rosettacode.org/wiki/Sorting_algorithms/Cocktail_sort.

# Card Trick Algorithm – APCSP

APCSP Card Trick:

Algorithm:

Citations for other card tricks:

wikiHow. “How to Perform a Card Trick Using Math.” WikiHow, WikiHow, 25 Sept. 2017, www.wikihow.com/Perform-a-Card-Trick-Using-Math.

There are lots of different card tricks on this website but I only looked at the first one, I didn’t choose it because it was too hard and complicated it was hard for me to understand. At first I tried to learn it but I kept messing up.

“Math Card Tricks.” Www.onlinemathlearning.com, www.onlinemathlearning.com/math-card-tricks.html.

Again this website had a lot of different card tricks but I only looked at the top one which is called the AweSum 10. Again this card trick was very complicated so I decided to do a different card trick.

Mobc, and Instructables. “How to Do a Cool and Simple Card Trick.” Instructables.com, Instructables, 1 Dec. 2017, www.instructables.com/id/How-to-do-a-Cool-and-Simple-Card-Trick/.

This card trick was good but I had to choose between the one I did and this one and I choose the one I did because the one I did made the audience think behind the trick more and it was less complicated than this one.

Red-Black Card Trick.” Red-Black Card Trick — Math Fun Facts, www.math.hmc.edu/funfacts/ffiles/10003.1-8.shtml.

This is the card trick I eventually picked. I picked this crd trick because it is really interesting and it involves simple yet hard to figure out math. I explain this card trick in my algorithm. The reason why there will always be the same amount of red cards as black cards in opposite decks is because the when you split the pile into two decks the red and black cards will always be the same because you are simply subtracting the same remaining red cards and black cards. The website I linked here explains the math behind this trick in depth.

# Research for APCSP Explore Task Summative – Jacob

Researched and started writing responses on the APCSP Explore Task summative. Researched the controversial effects of GPS.

My citations so far:

1. How Does GPS Work?| Explore, www.physics.org/article-questions.asp?id=55.

1. “When GPS Tracking Violates Privacy Rights.” The New York Times, The New York Times, 22 Sept. 2012, www.nytimes.com/2012/09/23/opinion/sunday/when-gps-tracking-violates-privacy-rights.html.

# Big data

Searching Rishab

1. Can’t find anything on Rishab
2. Don’t know
3. Nope

Searching myself

1. Couldn’t find myself
2. I live in Chung Hom Kok but doesn’t tell you online because you can’t find me online.
3. Nope

Searching Karan

1. He has a youtube, high schooler lives in Hong Kong
2. Hong Kong but can’t find exact address
3. Not really

# Blown to Bits Chapter 3 summary

In this chapter the author says that the transition from the physical world to the digital world is not as easy as anticipated. A story the author shares is the 2004 incident between an Italian journalist and American soldiers. This shows that some programs have the sense that physical copies are the same as digital copies. After the incident the military realised a report on the digital copy secret information was blacked out but an Italian blogger just unhighlighted the blacked out bits and there was text underneath the blacked out bits.

# How can Data be Represented

I was able to do PDF, Jpeg, TIF and PNG.

The resolution size is 1072 by 720 pixels for png, jpeg and tif but it is different for the PDF file.

PDF is 105 kilobytes, the PNG file is 779 kilobytes and the jpeg is 101 kilobytes and the Tiff file is 2.3 megabytes.

The reason the PNG file is so large is because it make the image into multiple layer whilst jpeg and pdf is only one layer. TIFF files are so large because there is no compression of the image when it is saved.

You can’t compress a jpeg to a tiff because a jpeg has already lost it’s quality because it is a jpeg, but you can convert a tiff to a jpeg because a tiff already has its quality.

I found out that pdf are the smallest image files and that tiff are the largest image files and that png files are larger than jpeg and PDF files. gateway-arch

Audio:

Sampling is the rate of which the data is converts from a signal to digital form.

Lossy audio is MP3, WMA

Lossless formats are WAV, FLAC and M4a

The number of bits per second that can be transmitted along a digital network.

Frequency × bit depth × channels = bit rate

Video:

Codec: A digital program used to encode or decode digital data or signals.

Videos that can be used for different devices:

AVI, ASF, MOV

Original video:

New video:

I changed the video size from 6.5 MB to 1.1 MB. So I shrunk it by almost 6 times its original size.

# The Internet and Society

For my project I choose internet censorship, I explain what websites are blocked and modern issues especially with China.

Pros of Internet censorship:

• Helps with crime, if the government blocks crime websites people won’t do crime because of this
• Helps with safety of the internet and the country, stops and uprising against the government

Cons of Internet censorchip

• Obviously freedom of press and speech online is under attack in China
• Government can manipulate what people read ultimately advancing the government’s agenda.

How the internet is blocked (Connection to what we have learned)

• DNS filtering and redirection is when blocked domain names are not resolved and the user is redirected
• URL filtering is when the URL string is scanned for target keywords, China uses this to block access to information regarding the Tiananmen Square protests
• IP address blocking is access to a certain IP address is denied. If the target Web site is hosted in a shared hosting server, all websites on the same server will be blocked.
• Network Disconnection is to completely cut off all routers, either by software or by hardware

Details learned to support my opinion

• Gambling websites and drug websites should be blocked to promote a safer place on the internet and to decrease crime
• China’s censorship of the press and Tiananmen square is wrong because it violates basic human rights (freedom of press and speech)

This Video explains China’s censorship of the internet well
Citations:

“Internet Censorship.” Wikipedia, Wikimedia Foundation, 14 Oct. 2017, en.wikipedia.org/wiki/Internet_censorship.

“How China Has Censored Words Relating to the Tiananmen Square Anniversary.” Public Radio International, www.pri.org/stories/2016-06-03/how-china-has-censored-words-relating-tiananmen-square-anniversary.

Schmidt, Eric, and Jared Cohen. “Web Censorship: the Net Is Closing In.” The Guardian, Guardian News and Media, 23 Apr. 2013, www.theguardian.com/technology/2013/apr/23/web-censorship-net-closing-in.

Toyama, Kentaro. “How Internet Censorship Actually Works in China.” The Atlantic, Atlantic Media Company, 2 Oct. 2013, www.theatlantic.com/china/archive/2013/10/how-internet-censorship-actually-works-in-china/280188/.

Images:

# The Internet should be for Everyone

I made a presentation presenting my point of view on my topics:

# Abstraction Summative – Jacob

Definition of Abstraction:

A simpler way of representing something

An example of abstraction is google maps it is a simpler way of representing streets.

I made my abstractions by starting at the most complex form of abstraction which was pseudo code. Then I made the pseudo code simpler by just outlining the steps the pseudo code takes which was a flowchart. Finally I made my simplest form of abstraction which was a paragraph explaining the machine. The process of doing this is done by starting of using a complicated form of abstraction and making the representation simpler. Doing this helps programmers write code because they know what to write rather than getting confused by looking at something complicated.

Psuedo code:

Flow chart middle tier of abstraction:

Simplest way of abstraction:

Flowchart (middle tier of abstraction) improved:

Abstraction can be very useful for programming as demonstrated here. In programming it is easier to create a simpler way of representing the program and code from there instead of using a very complicated form of the code. Abstraction can be used for mathematical problems such as the Konigberg bridges problem where Euler used abstraction to solve the problem by represent the seven bridges more simply. The Konigsberg bridge problem was is it possible only to walk on one time on each bridge in a day and Euler found with the help of his abstraction that it was impossible. The simplest form of abstraction won’t give you details but will provide a good founding base to code and once you start coding the more detailed parts the more complicated abstraction you need.

Konigsberg bridge problem Abstraction image:

Abstraction Code:

https://github.com/theweponyrebel/APCSP/blob/master/Abstraction%20Summaitve.py

My code has different abstraction levels to it one being complex form of abstraction and one being low form of abstraction. I have a print statement and a input variable that are very low forms of abstraction they are low levels of abstractions because they are simple code. My higher forms of abstraction are the function that is a more complex form of abstraction because it is more complicated code.

Why is a high level program easier to understand than a lower-level language in a program?

A high level program will use code that sounds more like english than a lower level program. Also a higher level program will be more streamline and organised rather than a lower level program that might have a lot of if statements and print statements.

Sources:

“Seven Bridges of Königsberg.” Wikipedia, Wikimedia Foundation, 27 Aug. 2017, en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg.