1. Home
  2. Explore
  3. Computer Science
  4. Introduction to Programming

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to Programming

  • 59Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Computers and Programs

What makes a computer different from most traditional machines?

59 questions

  1. 1

    What makes a computer different from most traditional machines?

    Model answer

    A computer can be given instructions to perform many different types of tasks, whereas most traditional machines are designed primarily for one task.

    Explanation

    A car engine is designed to power a car, and a sewing machine is designed to sew. A computer can browse the web, stream video, run applications, and perform many other tasks.

  2. 2

    How can installing an application change a computer’s functionality?

    Model answer

    Installing an application gives the computer a new set of instructions that enables it to perform an additional task.

    Explanation

    For example, installing a video-streaming application allows a smartphone or computer to stream video. The hardware does not need to be redesigned for each new function.

  3. 3

    Why might a computer be placed inside a device that has only one main purpose?

    Model answer

    Using a computer may be simpler and less expensive than building a specialized electronic or electromechanical system to control the device.

    Explanation

    Modern cars, sewing machines, and pipe organs may contain computers even though each device has a specialized purpose. Instructions stored on the computer control the device.

  4. 4

    Define programming.

    Model answer

    Programming is the act of creating instructions that a computer can follow to accomplish a task or gain new functionality.

    Explanation

    Programming allows people to create applications and other software that direct a computer’s actions.

  5. 5

    What is a program?

    Model answer

    A program is a set of instructions that a computer can follow to complete a task.

    Explanation

    Web browsers, mobile applications, video games, and operating systems are all examples of programs because they contain instructions for a computer.

  6. 6

    How are the terms program and software related?

    Model answer

    Software is a broad term for programs and other sets of computer instructions, while program often refers more specifically to an individual application or set of instructions.

    Explanation

    Firefox, File Explorer, and a video game can each be called a program, and all of them are also software.

  7. 7

    What role does an operating system play in a computer?

    Model answer

    An operating system is software consisting of instructions that allow users to interact with and operate a computer.

    Explanation

    Windows, iOS, and Android are operating systems. Like other programs, they are created from instructions that the computer follows.

  8. 8

    How can a program support user interaction?

    Model answer

    A program can accept actions such as typing information or clicking buttons, process those actions, and use them to perform a task.

    Explanation

    In an online appointment form, a browser receives the user’s typed information and button clicks and passes the submitted information to a web server.

  9. 9

    What is a programmer?

    Model answer

    A programmer is a person who creates programs by writing instructions that make a computer perform tasks.

    Explanation

    The programmer develops the instructions that applications and other software use to accomplish their intended functions.

  10. 10

    Why is programming considered a way to use a computer as a problem-solving tool?

    Model answer

    Programming lets people create their own computer-based solutions instead of being limited to the applications and operating-system features created by others.

    Explanation

    By writing programs, users can make computers solve problems and perform tasks that were not built into the original computer design.

  11. 11

    What type of information do computers directly understand?

    Model answer

    Computers directly understand binary information represented by electrical signals in on or off states.

    Explanation

    The on and off states form binary digits, which can be assembled into binary numbers that represent information.

  12. 12

    Why did early programmers have to work with binary instructions?

    Model answer

    Because computers directly understand binary, early programmers had to express computer instructions in binary form.

    Explanation

    Binary instructions correspond directly to the electrical states that computer hardware can process.

  13. 13

    What is assembly language?

    Model answer

    Assembly language is a more human-readable way of writing instructions that can be translated directly into binary.

    Explanation

    Assembly languages use textual representations of low-level instructions, reducing the need to write long sequences of ones and zeros.

  14. 14

    What is one advantage of writing programs at the binary or assembly level?

    Model answer

    The programmer can control individual instructions closely and optimize the program for speed or precise hardware behavior.

    Explanation

    Because each instruction is specified directly or nearly directly, the programmer knows exactly what actions the computer is being told to perform.

  15. 15

    Why might assembly language still be used today?

    Model answer

    Assembly may be used when a program requires highly specific optimization or precise control over computer operations.

    Explanation

    Although most programmers use higher-level languages, low-level control can be valuable for specialized performance or hardware-related problems.

  16. 16

    What are two major disadvantages of programming in binary or assembly language?

    Model answer

    It requires writing large amounts of difficult-to-read code, making development slow and errors difficult to detect.

    Explanation

    Even simple features such as displaying an image or detecting a mouse click may require many low-level instructions, which can also cause physical strain and obscure mistakes.

  17. 17

    Why would creating a graphical window be especially difficult in binary or assembly language?

    Model answer

    The programmer would need to write low-level instructions for displaying images, detecting mouse clicks, and determining whether clicks occurred in meaningful locations.

    Explanation

    Higher-level languages consolidate many of these operations into easier commands, while low-level programming requires implementing the details manually.

  18. 18

    What is the purpose of a programming language?

    Model answer

    A programming language provides a more human-readable way to write instructions that can be translated into binary instructions for a computer.

    Explanation

    Programming languages use familiar words and structures, making them easier to remember and use than raw binary or assembly instructions.

  19. 19

    How do programming languages simplify programming?

    Model answer

    They often replace many binary instructions with a single understandable command and handle the translation into appropriate binary instructions.

    Explanation

    This reduces the amount of code programmers must write and makes complex functionality easier to create and maintain.

  20. 20

    Name four programming languages mentioned in the content.

    Model answer

    Examples include C, C++, Java, JavaScript, and Python.

    Explanation

    These are programming languages in which programmers can write human-readable instructions for translation into computer-executable instructions.

  21. 21

    What happens after a programmer writes instructions in a programming language?

    Model answer

    The instructions are translated into binary instructions, which the computer then runs to accomplish the intended task.

    Explanation

    Translation may occur before execution or while the program is running, depending on whether a compiler or interpreter is used.

  22. 22

    What does a compiler do?

    Model answer

    A compiler translates source code into an executable program before the program is run.

    Explanation

    Visual Basic uses a compiler to turn the programmer’s written code into a program that the computer can execute.

  23. 23

    What does an interpreter do?

    Model answer

    An interpreter reads code during execution and performs its instructions without compiling the entire program ahead of time.

    Explanation

    Both interpreted and compiled programs ultimately cause the computer to execute binary instructions, but translation occurs at different stages.

  24. 24

    What is a programming language paradigm?

    Model answer

    A programming language paradigm is a general style or way of thinking about programming that can make certain tasks easier to accomplish.

    Explanation

    Object-oriented programming is one paradigm. It organizes software around interacting objects rather than only around a sequence of steps.

  25. 25

    What is the central idea of object-oriented programming?

    Model answer

    Object-oriented programming models a program as a collection of objects that interact with one another.

    Explanation

    Instead of describing only step one, step two, and step three, the programmer defines objects and the ways those objects communicate and act.

  26. 26

    How might an application object and a button object interact?

    Model answer

    The application object can position the button, and the button can notify the application to perform a task when the user clicks it.

    Explanation

    This example illustrates how objects have responsibilities and communicate in response to events.

  27. 27

    What is an object in object-oriented programming?

    Model answer

    An object is a program entity that can be seen, used, or conceptually interacted with within the program.

    Explanation

    Objects represent elements of a program and are generally responsible for performing actions or interacting with other objects.

  28. 28

    What are properties of an object?

    Model answer

    Properties are characteristics or stored information associated with an object.

    Explanation

    For example, a teacher object may have a name and a list of classes being taught, while a student object may have a name and a list of enrolled classes.

  29. 29

    What kinds of capabilities can objects have besides properties?

    Model answer

    Objects can perform functions based on instructions and interact with other objects.

    Explanation

    An object may be told to carry out procedures, and its class determines which actions are available to it or to other objects.

  30. 30

    What is a class?

    Model answer

    A class is a pattern or blueprint used to create objects.

    Explanation

    A class defines the properties, actions, and interactions that objects created from it will have.

  31. 31

    What does a class define for its objects?

    Model answer

    A class defines the objects’ properties, what they can do, and how other objects or parts of the program can interact with them.

    Explanation

    A class can specify whether a procedure is publicly available to other objects or restricted so that only the object itself can invoke it.

  32. 32

    What is an instance of a class?

    Model answer

    An instance is one specific object created from a class.

    Explanation

    A class may be used to create many objects, and each individual object is an instance of that class.

  33. 33

    What does it mean to instantiate an object?

    Model answer

    To instantiate an object means to create that object using the pattern defined by a class.

    Explanation

    When Visual Basic is instructed to create an object from a particular class, it instantiates that object.

  34. 34

    Using the teacher example, distinguish a class from an object.

    Model answer

    The teacher class defines that teachers have properties such as a name and teaching assignments, while an individual teacher is an object instantiated from that class.

    Explanation

    The class is the general pattern; a particular teacher, such as an employee represented in a college system, is one instance of that pattern.

  35. 35

    How can a student class and a teacher class be modeled using properties?

    Model answer

    A student object can have a name and a list of classes taken, while a teacher object can have a name and a list of classes taught.

    Explanation

    These properties describe information associated with each type of object. Classes may also define actions that their objects can perform.

  36. 36

    How can a teacher object’s properties change over time?

    Model answer

    The teacher’s list of classes can be updated when classes are assigned, and the teacher can perform actions such as teaching students or grading assignments.

    Explanation

    Objects contain data and behavior that may change or be used as activities occur in the program.

  37. 37

    How can a class object and a teacher object reference each other?

    Model answer

    A class object can store its teacher, while the teacher object can store that class in its list of classes taught.

    Explanation

    This creates a relationship in which each object contains information referring to the other.

  38. 38

    How does grading an assignment illustrate object-oriented programming?

    Model answer

    The teacher interacts with a class object, locates an assignment object within that class, and uses student-submission information to assign points.

    Explanation

    The process involves multiple objects—teacher, class, assignment, and students—whose properties and behaviors work together to complete the task.

  39. 39

    What is an integrated development environment, or IDE?

    Model answer

    An IDE is a program that helps programmers create, run, test, and build applications within one software environment.

    Explanation

    An IDE combines activities that previously required a text editor, separate execution commands, and external testing tools.

  40. 40

    How did an IDE improve upon the older text-editor-based development process?

    Model answer

    It integrated code writing, program execution, testing, and application building instead of requiring programmers to perform these activities manually with separate tools.

    Explanation

    Older workflows often used a basic text editor, manually launched a compiler or interpreter, and relied on external testing programs.

  41. 41

    What is a graphical user interface, or GUI?

    Model answer

    A GUI is a program component that lets users see and interact with software through visual elements and input devices such as monitors, mice, keyboards, or touchscreens.

    Explanation

    Icons, images, buttons, and other visual controls allow users to interact with programs without relying entirely on text commands.

  42. 42

    How does a smartphone GUI support user interaction?

    Model answer

    It provides visual controls that users can tap to launch programs or interact with them.

    Explanation

    A phone’s GUI performs a role similar to a mouse-and-keyboard interface on a laptop or desktop.

  43. 43

    Why is a GUI considered part of a program rather than a separate concept?

    Model answer

    The program contains instructions for creating and controlling the graphical interface through which the user interacts with the program.

    Explanation

    A GUI is a component of the application, implemented through code like the other functionality of the program.

  44. 44

    What is an application?

    Model answer

    An application is generally a program with a graphical user interface.

    Explanation

    Applications typically let users interact through visible icons, images, buttons, a mouse, a keyboard, or similar input devices, unlike entirely text-based programs.

  45. 45

    Contrast an application with an entirely text-based program.

    Model answer

    An application generally provides visual elements and graphical interaction, whereas an entirely text-based program operates through a terminal, shell, or similar text interface.

    Explanation

    The distinction concerns how users interact with the program: graphical controls in an application versus typed text in a text-based environment.

  46. 46

    What is the typical job of a professional programmer?

    Model answer

    A professional programmer creates computer-based solutions to problems faced by a company or its users.

    Explanation

    The solution may become part of a company’s information system or workflow, or it may be software that other companies use.

  47. 47

    In what employment arrangements might programmers work?

    Model answer

    Programmers may work as full-time employees, contract workers, or members of a team developing software for other organizations.

    Explanation

    Regardless of the arrangement, their work involves developing computer solutions to meet organizational needs.

  48. 48

    Why must a programmer solve a general problem rather than only one specific case?

    Model answer

    A useful program must handle all relevant instances of a problem, such as different numerical values or different users, rather than only one set of inputs.

    Explanation

    Programming requires creating an abstract solution that works across possible situations instead of manually solving a single example.

  49. 49

    What is the first step in the programming workflow?

    Model answer

    The first step is to meet with the people who will use the program and understand their needs and the problem to be solved.

    Explanation

    Users should have a say in the solution because they understand the missing capabilities and workflow the software must address.

  50. 50

    Why should programmers understand the users’ problem before writing code?

    Model answer

    Understanding the problem and users’ needs helps the programmer determine what the software must do and how it should fill the missing pieces.

    Explanation

    Without this understanding, the programmer may build a technically functional program that does not solve the users’ actual problem.

  51. 51

    What should a programmer do after understanding the problem but before coding?

    Model answer

    The programmer should plan a solution by identifying the tasks the program must perform and determining how each task will be solved.

    Explanation

    Planning the program’s behavior before implementation helps prevent confusion and loss of direction.

  52. 52

    What does the term cowboy coding describe?

    Model answer

    Cowboy coding describes starting to write code without first planning how the program and its tasks should work.

    Explanation

    The content presents cowboy coding as an approach that can make it easy for programmers to lose their way.

  53. 53

    Why is planning before coding important?

    Model answer

    Planning clarifies the program’s required tasks and the solutions for those tasks, making implementation more organized and reducing the risk of losing direction.

    Explanation

    The programmer should determine how the program should work before writing the code that implements it.

  54. 54

    What occurs after the solution has been planned?

    Model answer

    The programmer codes the program, tests it, checks whether users like it and whether it solves their problems, and then delivers the final product.

    Explanation

    The workflow connects implementation with technical testing, user feedback, and final delivery.

  55. 55

    What is alpha testing intended to verify?

    Model answer

    Alpha testing verifies internally that the program works correctly, does not crash, and has been implemented properly.

    Explanation

    Alpha testing focuses on the program’s internal technical correctness before or alongside broader user evaluation.

  56. 56

    What is beta testing intended to verify?

    Model answer

    Beta testing verifies that users like the program and that it solves the problems they need solved.

    Explanation

    Beta testing emphasizes the users’ experience and whether the completed functionality meets their practical needs.

  57. 57

    How does the Software Development Life Cycle approach differ from an Agile approach as described?

    Model answer

    The Software Development Life Cycle may attempt to complete the process with minimal repetition, whereas Agile uses short development bursts followed by testing, user feedback, and repeated improvement.

    Explanation

    Agile repeatedly cycles through implementation, testing, and feedback, while the other approach is described as trying to minimize repetition.

  58. 58

    Why might a development team repeat testing and development activities?

    Model answer

    The team may repeat them to identify problems, incorporate user feedback, and improve the solution until it works properly and meets users’ needs.

    Explanation

    The amount of repetition depends on the workflow and on whether potential users are available to test the program regularly.

  59. 59

    What factors can influence the choice of programming workflow?

    Model answer

    The workflow depends on what works best for the programmer or team and for the people they are working with, including whether users can test the software frequently.

    Explanation

    Not every project can obtain continuous user feedback, so the development process may need to be adapted.

1 of 59
Question 1 of 59

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent