Component 2.3 - Programming Languages Flashcards
What does HTML stand for?
Hyper Text Markup Language
Why are web standards such as HTML important for programmers?
Web standards simplify the development of web pages as web programmers will be able to understand another developer’s code.
Why are web standards such as HTML important for the end user?
Following standards ensures that different web browsers are able to display web pages in the way they were intended
Shat is HTML?
HTML is a standard used for creating web pages
What are the first and second tag in a pair of HTML tags called?
1st - opening tag
2nd - closing tag
What does the text between < html > and < / html > do?
This text describes the web page
What is < head > in HTML?
The element is a container for all head elements, including metadata, title for the document, scripts, styles
What would metadata be used in html for?
Metadata is used in html to describe the page, include key words, author of documents, time last altered etc
What does the text between < body > and < /body >tags do?
This text includes the contents of the web page
What does <p> do?</p>
The <p> tag defines a paragraph. Web browsers will add some space before the end for every </p><p> element automatically</p>
What tags are used to hyperlink an element within a web page?
<a> and </a>
What is the tag(s) for displaying an image in html?
<img></img>
What are the tags for headings, bold, italic, centre align, underline in html?
Headings - <h1> to <h6> Bold - <b> Italic - <i> Centre align - </i></b> Underline - <u>
All end with </u></h6></h1>
What is the <ul> and </ul> tags used for in html?
The <ul> tag is used for an unordered list</ul>
How can a bullet point list of elements apples, oranges, pears be made in html?
By using the <ul> tag for an unordered list then the <li> tag for each line in the list.
<ul><li>Apples</li><li>Oranges</li>
...
</ul>
</li></ul>
What is <blockquote> tag used for in html?</blockquote>
The <blockquote> tag is used to specify a section that is quoted from another source. Web browsers will indent <blockquote> elemenets</blockquote></blockquote>
What is the <hr> tag used for in HTML and what does it stand for?
The <hr> (horizontal rule) tag is a single tag (no closing tag) used to separate content in a HTML page (bigger gap)
What is the difference between assembly code and machine code?
Assembley code has the same structure and functions as machine code but it uses mnemonics (names) rather than binary code (1s 0s)
Order Python, hardware, machine code, assembly code, high level languages?
Python, high level languages, assembly language, machine code, hardware
What is the advantage of assembly level programs?
They:
- require less memory and execution time
- Allow code to interact directly with hardware (e.g. drivers)
- Are suitable for time-critical purposes
What os unique about machine code and assembly language?
Each type of computer has it’s own machine code and assembly language, so a program written in machine/assembly code for one CPU won’t run on another type of CPU
What is the assembly mnemonic for the Input instruction and what does it do?
INP - Inputs a value and stores in the accumulator
What is the assembly mnemonic for the Output instruction and what does it do?
OUT - displays the contents of the accumulator
What is the assembly mnemonic for the Store instruction and what does it do?
STA - transfers a number from the accumulator to RAM
What is the assembly mnemonic for the Load instruction and what does it do?
LDA - Transfers a number from RAM to the accumulator
What is the assembly mnemonic for the Add instruction and what does it do?
ADD - adds the contents of the accumulator to the contents of the RAM address
What is the assembly mnemonic for the Subtract instruction and what does it do?
SuB - subtracts the contents of the accumulator from the contents of a RAM address
What is the assembly mnemonic for the Branch instruction and what does it do?
BRA - jump to the specified ram location (for loops)
What is the assembly mnemonic for the End/Stop/Halt instruction and what does it do?
HLT - stopps the processor
What is the assembly mnemonic for the Data definition instruction and what does it do?
DAT - defines variables (e.g. first DAT, declare first as variable)
What is an Object Oriented Programming language?
A programming language involving A collection of objects that communicate to each other
What is an Object in an OOP (Object Oriented Programming language)?
An object has states and behaviours
What is a Class used for in an OOP (Object Oriented Programming language)?
A class is used to describe one or more objects. It is a plan or template for creating objects within a program
What is the rule for naming classes?
Class names must always begin with an uppercase
What is a Method in an OOP (Object Oriented Programming language)?
A method is a behaviour, one class can obtain many methods
What is the rule for naming methods?
Methods must start with a lower case letter
What is an Instance Variable in an OOP (Object Oriented Programming language)?
Instance variables are variables bound to class instances (e.g. game of wombats eating leaves, each wombat has a leaves variable storing the number of leaves it ate independently)
What components make up an OOP language?
Objects, classes, methods, instance variables
What are the four main properties of OOP languages that reduce the amount of code you need to write?
Encapsulation, Abstraction, Inheritance, Polymorphism
What is encapsulation?
Encapsulation is the process of wrapping data and the code that operates on it into a single entity
Give an example of encapsulation in OOP languages?
The varaibles and methods are wrapped up in a class
What is abstraction in OOP languages?
Abstraction is the process of hiding non-essential features and showing only essential features
What is an example of abstraction in green foot?
A wombat’s states e.g. name, breed can be hidden but behaviours e.g. burrow are not
What is Inheritance? (Part of an OOP language?
Inheritance is a feature of OOP languages that allows a new class to use the properties and methods of an existing class.
What is the derived class and base class called? (Inheritance)
Derived - the subclass Base class - superclass
A superclass can have ___ subclasses and a subclass can inherit from __ superclass
Many, one
How does inheritance in OOP languages work?
The new derived class (e.g. wombat) inherits the states and behaviours of the existing base class (e.g. Actor)
Subclasses can have their own methods and variables in addition to superclasses.
This is a statement not a question
What is polymorphism?
Polymorphism is a concept that allows actions to act differently based on the object performing them