T1A1 - Workbook
DNS, or the Domain Name System is like a phone book for the internet. When we type a domain name on the browser like google.com, DNS translates the URL into an IP address so that the browser can contact to that address to request online contents.
Before DNS, people had to remember IP address to get information from the internet. DNS made internet use easy and user friendly.
DNS info link
WWW, or the world wide web is the collection of online contents where each content is in HTML format and we can access it via web browsers using the internet.
Sir Tim Berners-Lee invented the world wide web in 1989 to easily share experiment data with fellow scientists. He relied on three main technologies namely HTML (Hypertext Markup Language), URL (Uniform Resource Locator), and HTTP (HyperText Transfer Protocol) to make www work.
Berners-Lee first published public website in 1991. The purpose of the website was to explain what the world wide web is and the use of it.
This is really an important event because despite having the opportunity to sell the technology, Sir Berners-Lee makes it an open source and made a great contribution for a better connected world.
YouTube is a video sharing platform based on America but widely popular throughout the earth. Chad Hurley, Steve Chen, and Jawed Karim co-founded YouTube in 2005. It started as an entertainment video sharing platform but now-a-days we can find all sort of tutorials and educational material here. I belive YouTube has helped people to dream of a world where education will be free for everyone.
Internet phones also known as broadband phone was introduced back in 1995 and was developed by Vocal Tech Communications Ltd. Similar to traditional phone, we use this technology for communication using voice but it uses the internet instead of electrical energy. It is most widely used Voice over Internet Protocol (VoIP) application device. It was one of the stepping stone for current days Skype, zoom, canvas, google meet etc.
Explain how each technology has contributed to the development of the internet.❓
Packets are how we get content from the internet. When we request a piece of information such as a website all the content arrives as a series of packets. Normally a packet has 1000 to 1500 bytes in it. Each packet contains information about its source, destination, how many packets are coming and the number of the particular packet. Packets help make internet faster as it breaks the whole content into smaller pieces.
source
IP Address, or the Internet Protocol Address is used to identify a unique machine on a network. When we request any information from the internet, the request contains our local machine IP address and the IP address where it can get the information. IP address like a physical address made it possible to send data to a destination.
source
Router is a network hardware that helps to connect home device with the internet. It is used as a first line of security to protect computer system and information from external attack. And routing is the process that routers use to find a path to send traffic.
source
source
A domain name is a unique identifying address that is used to visit websites. And the Domain Name System or DNS is like a phone book for the internet. When we type a domain name on the browser like google.com, DNS translates the URL into an IP address so that the browser can contact to that address to request online contents.
Explain how each technology has contributed to the development of client and server communication over the internet ❓:
TCP stands for Transmission control protocol. It maintains a connection with the host computer to the destination server via the port number with the guarantee to secure packets delivery. It considered as one of the main protocols of the Internet Protocol Suite as this makes sure the data is in the right order and none are missing. Which ensures the quality of communication between client and server.
source
HTTP, or The Hypertext Transfer Protocol is an application protocol that help to transfer data over the World Wide Web. HTTP also clarify how data are formatted and transmitted. It also defines what response should a browser take when it receives the data. While HTTP is unsecured, HTTPS, or the Hypertext Transfer Protocol Secure is secured. It protects the integrity and privacy of the data during communication between server and client.
source
source
A web browser is an application that we use to get content from the World Wide Web including webpages, images, video, and other files. When we request any information by typing domain address, it receives the requested content from the internet as HTML format and then display the information on a page. It makes communication between client and server really easy and user friendly.
source
❇ Three Data structures Used in Ruby Programming are:
.merge
method and the value can be retrieved later by using .fetch
method.In the world of computer science to do any kind of work we need to send the command to the computer. If I assume that a member of human species lands on an alien planet with a broken spaceship. Now the human needs some help from the alien but no one understands others language. We need a "middle man" helping hand to translate the need of humans to the member of the fellow alien species. If we suppose the alien friend is the computer and the instruction list to fix the spaceship is the command to be passed on, this is where the explanation of "Interpreter" and "compiler" starts. Suppose there are two types of helping robots that can translate the situation in the alien language.
The interpreter will take the list of notes from humans and will translate it step by step to the alien language and then the alien fellow will do that step. This one step at a time method can keep going until the work is done. And if by any chance human gives a wrong note, there is enough time to correct that by giving the right notes to Interpreter and let the alien do it again until the work is finished happily. Though it is a little slower in the end the space ship is all ready to fly up high again without any bigger harm.
On the other hand, the Compiler will take the list of notes, will translate the whole at once, and will say bye-bye. All this might be a little more time consuming but after this everything is going to be very fast. After handing over the translated list to the alien friend, he can fix the spaceship so fast without any interruption. Now if the human gave some wrong instruction by mistake that was translated by the compiler, there is no way to stop the alien friend for correcting the problem because the compiler is not there anymore. So in the end, there is a big chance of doing big harm to that spaceship. The process seems faster but there is a big chance of doing it all wrong while working with the compiler.
This is the exact way the interpreter and the compiler work on the computer.
The Interpreter is a computer program that starts right away, takes its time to run while translating the command, and gives the chance of fixing any mistakes by giving the chance of monitoring the result. The interpreter is always in between the program and the computer. It translates line by line.
The compiler is the program that takes an extra long time to prepare the translation all at once but after that, the program will run very quickly. Compiler piles together with the entire program and translates the whole thing all at once.
➡️ Source link for difference of interpreter and compiler
TWO commonly used programming languages:
Ruby:
require
statement is used to import a package or a modulenil
Java:
import
statement is used to load a packagenull
List of topics containing ethical issues:
For each ethical issue identify a source of legal information relating to the ethical issue and discuss whether the law is helpful in assisting a developer to act in an ethical way.
Conduct research into a case study of ONE of the ethical issues you have chosen discuss how an ethical IT professional should respond to the case study and how they might mitigate or prevent ethical breaches.❓
I think the following two issues are relevent to IT professionals.
Access to user's personal information ( medical, family, financial, personal attributes such as sexuality, religion, or beliefs)
GPS tracking data and other types of metadata, MAC address, hardware fingerprints.
Case Study:
An investigation into Vodafone Hutchison Australia following allegations that customer information had been compromised showed that the company’s business model provided access to the company’s databases of customer information to dealership employees via a shared store login ID.
Although the use of shared logins and the wide availability of full identity information is an inherent personal information security risk, in this instance the risk was increased by the fact that the entity had less control over information being accessed through dealerships, and no way of tracking or auditing who was accessing the information.
To prevent this IT professional could flag that issue when building the feature and could suggest instead of showing the information without individuals permission, it could ask permisson from user weather they want to show their information on different dealership stores.
resource1
resource2
Control flow is a major programming concept. Like other different programming languages, Ruby also uses conditionals and loops to control the flow of any program. Conditionals help execute code for a specific condition. For example, if we have a program that will display 'cold' when the temperature is under 10 degrees and display 'hot' when the condition is above 30 degrees, we can use Ruby language's if elsif else statement to check the temperature and display the message. Loops help execute code multiple times. For example, if we want to display a message 100 times we can use Ruby languages 'times' method to do that.
Type coercion is a technique that is used in programming to convert one object to another object. This is widely used when a type of a piece of data needed to change in order to do some calculation or manipulation. For example, for an e-commerce online store, if the price of different items are saved as a string, we need to convert the price to a number before we can do any mathematical operation on it. In ruby we use.'to_i' to convert string to number. Likewise, we can also convert numbers to string using 'to_s'. Ruby also has other methods such as 'to_f', 'to_a', 'to_h' to convert data type.
source
The data types recognised by the Ruby programming language are:
Number is a series of digit represent a mathematical number. It uses a dot as a decimal mark and underscore as a separator. As an example to add two numbers Ruby uses number to perform a mathematical operation. There are different kinds of numbers like Integers and Float.
2 + 2.5 = 4.5
2.class = Integer
2.5.class = Float
String represents a sentence or word. If we wrap a group of letters or numbers by a single quote('') or double quotes(""), it converts to a string.
"2".class = String
'name'.class = String
Boolean represent two states, either true or false. Ruby uses Boolean for conditional flows.
if true
print 'this is true'
else
print 'this is false'
end
true.class = TrueClass
false.class = FalseClass
Arry is used to store a list of data and they can hold any type of data and they are ordered. For example, if we want to store seven days in an array, their index will always be same
days = ["Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
days[0] = "Sunday"
days.class = Array
Hash is a key-value pair data structure which is commonly used to store data. For example, if we want to hold an user's information we can create a hash and store information like name and age as different pair. Keys can be a string, or a symbol, but the value could be any other data types.
user = {
name: 'Isabela',
age: 4,
}
user[:name] = "Isabela"
user[:age] = 4
user.class = Hash
Symbols are used as a light weight and better performing alternative of string. But symbol can only represent a word, whereas string can represent sentences. The most popular use of the symbol as a key of hashes.
user = {
:name => 'Isabela',
:age => 4,
}
user.keys = [:name, :age]
user.keys.first.class = Symbol
Menu class wil hold the name of foods with asigned price of it so the customer can choose their food from the menu with the knowledge of price.
Customer class will hold the details of each customer like, allargic alert, religous food choice, name, address, phone number so their favorite menu item could be saved for later.
Food class will hold description about food.Like the allergic ingredients alert, whole ingredients with the nutritional value of the item.
Explanation class is here to hold chossen menu and sum up the bill for next time history showing and payment issue.
Ordertaker class takes order list to chef for preparing the food item.
Foodserver will cook the food.
Foodmakre will serve the prepared food to the customer.
Paymenttaker takes the bill and gives change if required.
celsius = gets
fahrenheit = (celsius * 9 / 5) + 32
print "The result is: "
print fahrenheit
puts "."
Here, Celsius
is storing a string as an input which can not be coerced into integer. The stored input needs to convert into integer.
The correct code is
celsius = gets.to_f
print "The result is: "
fahrenheit = (celsius * 9 / 5) + 32
print fahrenheit
puts '.'
arr = [5, 22, 29, 39, 19, 51, 78, 96, 84]
i = 0
while (i < arr.size - 1 and arr[i] < arr[i + 1])
i = i + 1 end
puts i
item = arr[i]
arr[i] = arr[i + 1]
arr[i + 1] = item
i. Create a flowchart to outline the steps for listing all prime numbers between 1 and 100 (inclusive). Your flowchart should make use of standard conventions for flowcharts to indicate processes, tasks, actions, or operations
ii. Write pseudocode for the process outlined in your flowchart ❓
Initialize a prime number collection
For each number from 1 to 100
Initialize divisible counter to zero
For each number from 1 to this number
If that number is divisible by this number
add one to the divisible counter
If divisible counter is equal to two
add this number to prime number collection
print prime number collection
You have access to two variables: raining (boolean) and temperature (integer). If it’s raining and the temperature is less than 15 degrees, print to the screen “It’s wet and cold”, if it is less than 15 but not raining print “It’s not raining but cold”. If it’s greater than or equal to 15 but not raining print “It’s warm but not raining”, and otherwise tell them “It’s warm and raining”. ❓
def weather(temperature, raining)
if temperature < 15
if raining
puts "It’s wet and cold"
else
puts "It’s not raining but cold"
end
elsif temperature >= 15
if raining
puts "It’s warm and raining"
else
puts "It’s warm but not raining"
end
end
end
class Allergy
ALLERGIC_ITEMS = ['eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats']
attr_reader :score
def initialize(score)
@score = score
end
def reversed_binary
score.to_s(2).split("").reverse
end
def allergen_list
identified_alleregen = []
reversed_binary.each_with_index do |binary, index|
if binary == '1'
identified_alleregen << ALLERGIC_ITEMS[index]
end
end
identified_alleregen
end
def is_allergic?(name)
allergen_list.include?(name) ? true : false
end
end