☰ Year plan · Communication Technology

Operating systems and computer languages

Week 7 · Theme 1, Lesson 7 Operating Systems · 3 lessons
3

Computer languages and HTML

ICT P6 Term 1, Theme 1: pp. 34–37
GoalExplain what programming languages are and read a few lines of HTML as a puzzle.
New words
programming language · a special language used to write instructions for a computermachine language · the simplest language of a computer, made only of 0 and 1HTML · the language used to make web pagesbrowser · the program that shows web pages
Explanation

To give instructions to a computer, we write code in a programming language. The first languages were close to the way a machine works: only 0 and 1, like a switch that is off or on. This is machine language, and it is very hard for people. Over time, languages grew closer to human speech, with words like ‘print’ and ‘repeat’. A programmer chooses a language by its purpose. One is good for games, another for science, another for pages on the web. Once you have learned one language, the next is easier, because many ideas repeat. HTML is the language for making web pages. It works with text, links, pictures, audio and video, and every browser can read it. Look at the puzzle below. The tags in angle brackets tell the browser what each part is. The browser shows only the content.

Html
1<h1>My kite</h1>
2<p>It is red.</p>
3<p>It flies high.</p>
Output
My kite
It is red.
It flies high.
Worked examples
Html
1<h1>Cats</h1>
Output
Cats
Look at this line of code. The tag h1 makes the biggest heading. The browser shows only the word ‘Cats’, as a big heading, and not the tags.
Html
1<h1>Camels</h1>
2<p>They live in deserts.</p>
3<p>They store fat.</p>
Output
Camels
They live in deserts.
They store fat.
Karim reads the code: it has a heading and two paragraphs. The browser shows the heading first and then the two paragraphs, in the same order as the code.
From a switch to a language: a machine language is like a long row of switches, off and on. A programmer would rather say ‘repeat’ than set a hundred switches. So languages with words were invented.
Class activity

Page puzzle. Draw what the browser shows for these lines: a heading ‘My town’, a paragraph ‘We have a market.’ and another paragraph ‘There is a river.’ Then write the code that makes that page, using h1 and p tags with opening and closing tags. Swap with a partner and check.

Practice
1
What is machine language made of?
2
What is HTML used for?
3
What will the browser show for this code?
Html
1<h1>Nile</h1>
2<p>It is long.</p>
4
Why is it easier to learn a second programming language?