Year 3 Exam  >  Year 3 Notes  >  Year 3 Computing  >  How are computer programs constructed?

How are computer programs constructed? | Year 3 Computing PDF Download

Understanding Computer Programs

  • Computers and computing devices are often perceived as highly intelligent.
  • Sometimes, they are even considered more intelligent than people!
  • They excel at completing tasks that humans cannot do, often faster and more accurately. They are adept at multitasking.
  • However, it's important to remember that computers cannot think independently. They only execute instructions provided by humans in a language called code. These instructions collectively form a computer program.
  • Computing devices possess memory where they can store programs and other data.
  • We develop computer programs with the intention of having a computer or computing device perform a specific task. This task might be a standalone project or part of a broader effort to solve a problem.

Computer programs and stories

  • When crafting a story, we understand it requires specific structures to engage readers effectively.
  • The plot unfolds through a sequence of events, arranged typically as beginning, middle, and end. This progression forms the storyline.
  • Additionally, stories often feature character descriptions and vivid depictions of the setting to enrich the narrative.
  • Similarly, a computer program must adhere to certain structures to ensure it achieves the intended outcome as envisioned by the programmer.
  • Key structures in a computer program include:
    • The precise order or sequence of instructions.
    • The incorporation of instructions that may need to be repeated, enhancing efficiency and functionality.

Sequences - what comes first?

  • The sequence or order of instructions in any task is crucial because it directly influences the desired outcome.
  • Consider an everyday example where the sequence of instructions is vital to achieve the correct outcome: folding a T-shirt neatly.

How are computer programs constructed? | Year 3 Computing

Question for How are computer programs constructed?
Try yourself:
Which of the following is an important key structure in a computer program?
View Solution

Understanding Computers and Sequences

  • Computers, unlike people, lack the ability to detect errors in a sequence and will continue executing a program even if issues arise. 
  • This underscores the importance of meticulously checking algorithms and program code to ensure the correct sequence.

Real-World Application: Drinks Factory Example

In a drinks factory where machines are computer-controlled:

  • Move empty bottles automatically to different sections
  • Fill up the bottle
  • THEN put the lids on

Imagine a scenario where the computer program mistakenly instructs putting the lids on the bottles before filling them. This misstep would result in:
How are computer programs constructed? | Year 3 Computing

Repetition - let's do it again

  • Repetition, or doing something repeatedly, is a valuable method for learning and remembering new information or skills. Just like practicing a musical instrument or a sport, repetition helps reinforce memory and learning.
  • Imagine explaining to an alien how to tidy up your room. You would need to provide clear and precise instructions for each step. 
  • For instance:
    • Walk up to a toy on the floor
    • Pick up the toy
    • Put the toy in the toy cupboard

How are computer programs constructed? | Year 3 Computing

  • If there were 20 toys to tidy up, simply repeating the same set of instructions 20 times would be tedious and time-consuming.
  • In a computer program, repeating the same instruction multiple times can be inefficient. Instead, you can use programming constructs like loops to automate repetitive tasks.
  • If the alien were a robot, you could use a "repeat" instruction to make it tidy up all the toys without having to individually command it for each toy.
  • By using loops or repeat commands in programming, tasks can be accomplished more efficiently, similar to how the robot could tidy up the room much faster than if it followed individual instructions for each toy.
  • Just like how repetition can aid in learning and memory retention, using loops in programming can make tasks easier to handle and more time-effective.

Repeat loops in computer programs

  • Computers have the capability to repeat tasks endlessly without experiencing boredom or fatigue, unlike humans, which makes them incredibly useful.
    How are computer programs constructed? | Year 3 Computing
  • In programming, we can utilize REPEAT commands to streamline our programs, enhancing efficiency by reducing the number of lines of code required. Typically, we specify the number of repetitions before listing the instructions themselves.
    How are computer programs constructed? | Year 3 Computing
  • This approach significantly reduces the length of code needed for tasks, such as programming actions for an alien character.
The document How are computer programs constructed? | Year 3 Computing is a part of the Year 3 Course Year 3 Computing.
All you need of Year 3 at this link: Year 3
7 videos|26 docs|8 tests

Top Courses for Year 3

7 videos|26 docs|8 tests
Download as PDF
Explore Courses for Year 3 exam

Top Courses for Year 3

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Important questions

,

How are computer programs constructed? | Year 3 Computing

,

shortcuts and tricks

,

mock tests for examination

,

Viva Questions

,

MCQs

,

study material

,

practice quizzes

,

ppt

,

Sample Paper

,

pdf

,

video lectures

,

Extra Questions

,

How are computer programs constructed? | Year 3 Computing

,

Objective type Questions

,

Summary

,

How are computer programs constructed? | Year 3 Computing

,

Free

,

Semester Notes

,

Previous Year Questions with Solutions

,

past year papers

,

Exam

;