O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Sub programs

Amber Gregory Inglês 10 flashcards

Flashcards do conjunto (10)

  1. 1What are the 2 main types of sub program?Functions and procedures
  2. 2Describe the difference between a function and a procedureA function always returns a value and must take at least 1 argument or parameter. A procedure never returns a value and only takes arguments or parameters if needed.
  3. 3Describe the difference between a parameter and an argumentA parameter is the name of the variable being passed into the sub program. An argument is the actual value that is being passed.
  4. 4Sub programs are good for decomposition, what does this mean?This means that sub programs are very useful for breaking things down into smaller parts. This makes it easier for the instructions to be understood and reused if needed, saving space for more code.
  5. 5Give 2 advantages of using sub programsOne advantage of sub programs is that you can write in less lines of code. Instead of repeating codes, you can use a sub program to be more efficient. Another advantage is that the work can be reused meaning it will be quicker to develop new programs.
  6. 6What value would be returned? a = 1 b = 2 def add(a,b): total = a + b return total bonus: is this a function or procedure?The value returned would be 3
    bonus: function
  7. 7What type of calculations can the ALU perform?Addition, subtraction and binary shifts (binary shifts for multiplication and division)
  8. 8What does the accumulator do?Stores the intermediate results of the calculations
  9. 9What are the 4 different registers used in Von Neumann?Memory Data Register
    Memory Address Register
    Accumulator
    Program Counter
  10. 10What does the program counter do?Stores the next set of instructions that are about to be used, this allows the

Informações

Descrição
FlashCards sobre Sub programs , criado por Amber Gregory em 29-09-2021.
Criado por
Amber Gregory
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?