☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Code, changing pages and fixing problems

الأسبوع 21 · المحور الثالث، الدرس ٦ «البرمجة والمشكلات الرقمية وكيفية حلّها»: لغات البرمجة والمحتوى الثابت والمتغير وحلول المشكلات · 3 دروس
1

Programming languages and web pages

ICT P6 Term 2, Theme 3: pp. 30–33
GoalExplain what a programming language is and tell static web content from dynamic web content.
New words
programming language · commands written as sentences so that a computer knows what to doHTML · a language commonly used to build web pagesstatic content · web content that stays the same for every visitordynamic content · web content that changes with what the user does
Explanation

People speak many languages, and computers have languages too. A programming language is a set of commands written as sentences, so that a computer can follow them and run a program. Think of a recipe: the cook reads the sentences one by one and does what each says. HTML is one of the languages that people often use for web pages. A page made with HTML shows static content: it is set and stays the same for every visitor, like the opening hours of a library. Other pages need to change when a visitor does something, for example a score that goes up in a game. That is dynamic content. A language like JavaScript can create it. Note that JavaScript and Java are two different languages. Remember Week 8: HTML tags wrap each part of a page.

Static contentDynamic content
same for every visitorchanges with the user
built with HTMLbuilt with a language such as JavaScript
opening hoursgame score
Worked examples
A recipe is a list of commands for a cook. A program is a list of commands for a computer. Both are read one sentence at a time, in order, and both fail if a sentence is missing.
Html
1<h1>Town museum</h1>
2<p>It opens at 9 in the morning.</p>
Output
Town museum
It opens at 9 in the morning.
A fixed page. A town’s tourist page says ‘The museum opens at 9 in the morning’. Every visitor sees the same sentence, so it is static. It can be built with a few HTML lines.
PlayerAnswerScore
Habibaright3 → 4
Karimwrong3 → 3
A changing page. In a quiz game, Habiba answers a question and the score changes from 3 to 4. Karim answers wrongly and his score stays at 3. The page reacts to each person, so it is dynamic.
Class activity

Sentence hunt. In pairs, write five commands for a pretend robot that crosses a room, one sentence each, in the right order (for example: ‘Stand up’, ‘Walk three steps’). Swap lists and follow your partner’s commands exactly. What happens when one command is missing? Then write two pages you know that stay the same for everyone.

Practice
1
What is a programming language?
2
Give an example of static content.
3
What is dynamic web content?
4
Is JavaScript the same language as Java?