SLR 7
No description yet. This curated deck is ready for daily study.
Card preview (12)
Describe two differences between assembly language and high-level language
-Ass uses mnemonics -HLL uses English-like words -Ass uses an assembler to convert to machine code -HLL uses a translator to convert to machine code -Ass is a one-to-one conversion to machine code -HLL may produce multiple lines of machine code per line of code -Ass requires more knowledge of the processor/allows direct control of the processor -HLL provides more abstraction/requires less knowledge of the processor
Describe the advantages of using encapsulation
• Reduces the chance of errors • Ensures objects can only be changes in the way intended • Protecting data - can’t be changed accidentally
Define the term pipelining
• One instruction can be fetched while another is being decoded … • … and another is being executed • The output of one process is the input of the next • Concurrent processing of multiple instructions
Explain one benefit to a charity of using a processor that allows pipelining
• More instructions can be carried out in a set amount of time • Increasing the efficiency of the computer
Give two reasons why in some circumstances programmers will choose to write code in assembly language
• Quicker/more efficient to translate • Makes more efficient use of the CPU • The programmer wants direct control over hardware/memory • Code might be written for a specific architecture • Compilers/interpreters may not be available
Give 4 modes of memory addressing
• Direct • Immediate • Indirect • Indexed
State the meaning of an object
Object - instantiated from class
State the meaning of a method
Method - action object performs
State the meaning of attribute
Attribute - value held by object
An algorithm uses a while loop. State a different type of loop that could be used instead of the while loop
Do… until/repeat… until
Some print jobs can have different priorities. The higher the priority the sooner the job needs to be printed. Describe how a simple program could be changed to deal with different priorities.
• Use a different structure e.g. a linked list • …items can be added at different points in the linked list depending on priority • …by changing the pointers to items needing priority • have different queues for different priorities
Describe two benefits of using an object-oriented paradigm rather than a procedural paradigm.
• Code can easily be reused… • …classes can be used in other programs • …inheritance can be to extend upon existing classes • …as a class can be based on an existing class • Easier to maintain…. • ….as classes can be modified or extended • …debugging can be easier as encapsulation limits how attributes are changed. • Code can be more secure… • … as access to attributes can be restricted to being via methods. • Better for coding as part of a team… • …as classes can be distributed between team members.