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

  • 47Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Computers And Programs

What most fundamentally distinguishes a computer from a traditional single-purpose machine?

47 questions

  1. 1

    What most fundamentally distinguishes a computer from a traditional single-purpose machine?

    1. A

      A computer can receive different instructions and perform many types of tasks

    2. B

      A computer performs only the task specified when its physical parts are built

    3. C

      A computer operates without using electrical signals or stored information

    4. D

      A computer always performs mechanical tasks more quickly than other machines

    Correct answer
    A

    A computer can receive different instructions and perform many types of tasks

    Explanation

    Traditional machines are generally designed for one primary task, whereas computers can perform many different tasks when given different sets of instructions.

  2. 2

    Why might a computer be placed inside a modern sewing machine or automobile even if the device has one main purpose?

    1. A

      Computers ensure that the device can perform every possible human activity

    2. B

      Using a computer may be simpler than building a specialized electronic or electromechanical control system

    3. C

      Computers eliminate the need for any physical components in the device

    4. D

      Using a computer prevents the device from needing any instructions

    Correct answer
    B

    Using a computer may be simpler than building a specialized electronic or electromechanical control system

    Explanation

    A computer can control a device through instructions, which may be simpler than designing a complicated custom circuit or mechanical control system.

  3. 3

    Which example best illustrates a computer performing multiple tasks through different instructions?

    1. A

      A mechanical clock moves its hands at a regular rate

    2. B

      A sewing machine moves its needle according to fixed settings

    3. C

      A laptop browses the web and then streams a video

    4. D

      A car engine repeatedly moves its pistons in the same way

    Correct answer
    C

    A laptop browses the web and then streams a video

    Explanation

    A laptop can browse the web, stream video, run applications, and perform many other tasks because its behavior can be changed through software instructions.

  4. 4

    What gives a smartphone new functionality after the phone has been manufactured?

    1. A

      Installing applications that provide additional instructions and capabilities

    2. B

      Increasing the number of mechanical parts inside the phone

    3. C

      Replacing the phone's physical screen with a larger display

    4. D

      Changing the electrical signals into permanently fixed settings

    Correct answer
    A

    Installing applications that provide additional instructions and capabilities

    Explanation

    Installing apps gives a smartphone new functionality because each app contains instructions that enable the computer to perform additional tasks.

  5. 5

    Which statement best defines programming?

    1. A

      Programming is the replacement of an operating system with mechanical controls

    2. B

      Programming is the creation of instructions that enable a computer to perform a task

    3. C

      Programming is the physical construction of a computer's electronic components

    4. D

      Programming is the process of operating a computer without giving it instructions

    Correct answer
    B

    Programming is the creation of instructions that enable a computer to perform a task

    Explanation

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

  6. 6

    Which statement correctly describes a program?

    1. A

      A program is a set of instructions that a computer can follow

    2. B

      A program is exclusively the physical memory installed in a computer

    3. C

      A program is a machine that performs one task without stored instructions

    4. D

      A program is only the screen through which a user views information

    Correct answer
    A

    A program is a set of instructions that a computer can follow

    Explanation

    A program is a set of instructions that a computer can run to complete a task. Programs are also broadly called software.

  7. 7

    Which item is an example of a program or software?

    1. A

      A keyboard key without any associated instructions

    2. B

      A computer's external monitor by itself

    3. C

      A web browser such as Firefox or Chrome

    4. D

      A physical sewing needle without electronic controls

    Correct answer
    C

    A web browser such as Firefox or Chrome

    Explanation

    Web browsers, mobile apps, file-management tools, video games, and operating systems are all examples of programs or software.

  8. 8

    How can a program support user interaction on a website?

    1. A

      It can allow users to interact only by physically modifying the computer's hardware

    2. B

      It can prevent the browser from recognizing typed text or clicked buttons

    3. C

      It can process typed information and button selections and pass submitted data to a server

    4. D

      It can replace all network communication with a fixed image on the screen

    Correct answer
    C

    It can process typed information and button selections and pass submitted data to a server

    Explanation

    When a user fills out a form or clicks buttons, the browser processes those interactions and can send the submitted information to a web server.

  9. 9

    What is the role of an operating system such as Windows, iOS, or Android?

    1. A

      It is a binary digit that represents one electrical signal

    2. B

      It is a physical circuit that replaces every application on the computer

    3. C

      It is a single-purpose program used only to stream video

    4. D

      It is software containing instructions that help users interact with and use the computer

    Correct answer
    D

    It is software containing instructions that help users interact with and use the computer

    Explanation

    An operating system is software: a set of instructions that manages computer operation and allows users to interact with the computer.

  10. 10

    What do computers fundamentally use to represent information through electrical signals?

    1. A

      Natural-language sentences stored without any numerical representation

    2. B

      Mechanical movements that cannot be represented electronically

    3. C

      Binary states corresponding to signals that are on or off

    4. D

      Only decimal numbers entered directly by a programmer

    Correct answer
    C

    Binary states corresponding to signals that are on or off

    Explanation

    Computers use electrical signals in on or off states. These states represent binary digits, which can be assembled into binary numbers and meaningful information.

  11. 11

    Why did early computer programming require working directly with binary?

    1. A

      Computers directly interpret the binary instructions represented by their electrical states

    2. B

      Binary automatically explains the purpose of every instruction to the programmer

    3. C

      Computers cannot execute instructions that contain any numerical values

    4. D

      Binary is more similar to ordinary human conversation than other languages

    Correct answer
    A

    Computers directly interpret the binary instructions represented by their electrical states

    Explanation

    Computers fundamentally operate on binary instructions, so early programmers had to write instructions in a form the computer could directly understand.

  12. 12

    What was the main purpose of assembly languages?

    1. A

      They provided more human-readable instructions that could be translated into binary

    2. B

      They replaced all computer programs with natural-language conversations

    3. C

      They converted binary instructions into mechanical movements without software

    4. D

      They allowed computers to operate without any electrical signals

    Correct answer
    A

    They provided more human-readable instructions that could be translated into binary

    Explanation

    Assembly languages use somewhat more human-readable text than raw binary, and that text can be translated directly into binary instructions.

  13. 13

    What is one advantage of programming directly at the binary or assembly level?

    1. A

      The programmer can create complex interfaces without writing detailed instructions

    2. B

      The programmer automatically avoids all errors caused by low-level code

    3. C

      The programmer never needs reference materials or knowledge of the machine

    4. D

      The programmer has precise control over individual computer instructions and optimization

    Correct answer
    D

    The programmer has precise control over individual computer instructions and optimization

    Explanation

    Low-level programming gives detailed control over what the computer does, allowing programmers to optimize execution for specific needs.

  14. 14

    Why is writing programs directly in binary generally difficult?

    1. A

      Even simple features require many detailed instructions, making code difficult to write and debug

    2. B

      Binary cannot control displays, input devices, or other computer components

    3. C

      Binary instructions are automatically translated into unrelated programming languages

    4. D

      Binary prevents programmers from specifying the exact actions of the computer

    Correct answer
    A

    Even simple features require many detailed instructions, making code difficult to write and debug

    Explanation

    Creating features such as clickable buttons or displayed images in binary requires many low-level instructions. The volume and complexity make programming time-consuming and mistakes difficult to find.

  15. 15

    Why might assembly still be used in some modern situations?

    1. A

      It eliminates the need to translate instructions into a form the computer understands

    2. B

      It is always easier for beginners than a high-level programming language

    3. C

      It is the only language that can create programs with user interaction

    4. D

      It can provide highly specific optimization or control for particular problems

    Correct answer
    D

    It can provide highly specific optimization or control for particular problems

    Explanation

    Although most programming is done with higher-level languages, assembly can still be useful when precise optimization or machine-level control is required.

  16. 16

    What is the primary purpose of a programming language?

    1. A

      It helps programmers write human-readable instructions that can be translated into binary

    2. B

      It replaces the computer's hardware with a collection of written explanations

    3. C

      It ensures that every program consists of only one binary digit

    4. D

      It allows a computer to perform tasks without executing any instructions

    Correct answer
    A

    It helps programmers write human-readable instructions that can be translated into binary

    Explanation

    Programming languages use familiar words and structures to make instructions easier for humans to write and remember, then translate those instructions into binary.

  17. 17

    How do programming languages reduce the amount of code a programmer must write?

    1. A

      One convenient command can represent many lower-level binary instructions

    2. B

      They allow programmers to omit all instructions related to program behavior

    3. C

      They remove the need for the computer to perform any calculations

    4. D

      They store every command as a physical component rather than software

    Correct answer
    A

    One convenient command can represent many lower-level binary instructions

    Explanation

    A programming-language command can consolidate many binary instructions, allowing programmers to express complex operations more simply.

  18. 18

    Which list contains only programming languages mentioned in the content?

    1. A

      C, C++, Java, JavaScript, and Python

    2. B

      Compiler, interpreter, browser, and operating system

    3. C

      Keyboard, monitor, mouse, and smartphone

    4. D

      Windows, Android, Firefox, and Canvas

    Correct answer
    A

    C, C++, Java, JavaScript, and Python

    Explanation

    C, C++, Java, JavaScript, and Python are programming languages. Windows and Android are operating systems, while Firefox and Canvas are programs or applications.

  19. 19

    What does a compiler generally do?

    1. A

      It tests user satisfaction without running the program

    2. B

      It translates written source code into an executable program before execution

    3. C

      It displays a graphical interface without translating or executing code

    4. D

      It manually types binary instructions on behalf of the computer user

    Correct answer
    B

    It translates written source code into an executable program before execution

    Explanation

    A compiler translates source code into an executable program that can later be run. Visual Basic was described as using this kind of process.

  20. 20

    What distinguishes an interpreter from a compiler?

    1. A

      An interpreter reads code during execution and performs it without compiling everything ahead of time

    2. B

      An interpreter tests users while a compiler collects user requirements

    3. C

      An interpreter can translate only binary while a compiler can translate only English

    4. D

      An interpreter creates physical hardware while a compiler creates software

    Correct answer
    A

    An interpreter reads code during execution and performs it without compiling everything ahead of time

    Explanation

    An interpreter reads and executes code live, whereas a compiler generally translates the code into an executable form before it is run.

  21. 21

    What is a programming language paradigm?

    1. A

      A file format used exclusively for storing binary digits

    2. B

      A style or way of thinking about programming that can make certain tasks easier

    3. C

      A physical device that converts electrical signals into monitor images

    4. D

      A required sequence for installing applications on a smartphone

    Correct answer
    B

    A style or way of thinking about programming that can make certain tasks easier

    Explanation

    A paradigm is a programming style or conceptual approach that organizes how programmers think about and solve problems.

  22. 22

    What is the central idea of object-oriented programming?

    1. A

      A program is organized around objects that contain properties, perform actions, and interact

    2. B

      A program avoids interactions between its components by using fixed settings

    3. C

      A program can contain only graphical objects that users can see on a monitor

    4. D

      A program must be written as one uninterrupted list of binary instructions

    Correct answer
    A

    A program is organized around objects that contain properties, perform actions, and interact

    Explanation

    Object-oriented programming treats program components as objects that have properties, can perform functions, and can interact with other objects.

  23. 23

    How does object-oriented programming differ from a strictly step-by-step approach?

    1. A

      It emphasizes interactions among objects rather than only listing sequential steps

    2. B

      It requires every object to perform the same action in the same order

    3. C

      It eliminates the need to define what any program component can do

    4. D

      It represents all program behavior as raw electrical signals written manually

    Correct answer
    A

    It emphasizes interactions among objects rather than only listing sequential steps

    Explanation

    Instead of focusing only on instructions such as “step one” and “step two,” object-oriented programming focuses on objects and how they communicate or interact.

  24. 24

    Which statement best describes an object in object-oriented programming?

    1. A

      It is exclusively a physical item that can be touched outside the computer

    2. B

      It is a programming language that translates source code into binary

    3. C

      It is a testing process used to determine whether users like an application

    4. D

      It is something within a program that can be represented, used, have properties, or perform actions

    Correct answer
    D

    It is something within a program that can be represented, used, have properties, or perform actions

    Explanation

    Objects are program entities that can be seen, conceptually touched, or used within the program. They have properties, may perform functions, and can interact with other objects.

  25. 25

    Which relationship best illustrates object interaction in a graphical application?

    1. A

      An application object prevents every button from having properties or actions

    2. B

      A button translates all source code into binary without interacting with the application

    3. C

      A button permanently replaces the application object whenever a user clicks it

    4. D

      An application object positions a button, and the button signals the application when clicked

    Correct answer
    D

    An application object positions a button, and the button signals the application when clicked

    Explanation

    The example describes an application object interacting with button objects: the application can position a button, and the button can notify the application when clicked.

  26. 26

    What is a class in object-oriented programming?

    1. A

      A pattern or blueprint used to create objects

    2. B

      A binary instruction executed by the processor

    3. C

      A single object created from an existing pattern

    4. D

      A graphical device used to display program output

    Correct answer
    A

    A pattern or blueprint used to create objects

    Explanation

    A class defines the pattern for objects, including their properties, capabilities, and permitted interactions.

  27. 27

    What can a class definition specify about the objects created from it?

    1. A

      Only the binary digits used to store their names in memory

    2. B

      Their properties, available actions, and how other objects may interact with them

    3. C

      Only the color of their graphical representation on the computer screen

    4. D

      The physical construction of the computer that will run the objects

    Correct answer
    B

    Their properties, available actions, and how other objects may interact with them

    Explanation

    A class can define what its objects have, what they can do, and which procedures outside entities are allowed to request or access.

  28. 28

    What is an instance of a class?

    1. A

      A particular object created from that class's pattern

    2. B

      A property that every unrelated object must share

    3. C

      A compiler that translates the class into an operating system

    4. D

      A general pattern from which many classes are created

    Correct answer
    A

    A particular object created from that class's pattern

    Explanation

    An object created from a class is an instance of that class. A class may be used to create many individual instances.

  29. 29

    What does it mean to instantiate an object?

    1. A

      It means testing a program without creating any program objects

    2. B

      It means creating an object from the definition or pattern of a class

    3. C

      It means deleting every object that belongs to a class

    4. D

      It means translating a program directly into natural-language instructions

    Correct answer
    B

    It means creating an object from the definition or pattern of a class

    Explanation

    Instantiation is the process of asking the programming environment to create a particular object using a class as its pattern.

  30. 30

    If a teacher class defines a name and a list of courses, what would each teacher object receive?

    1. A

      A fixed list of every course taught by every teacher

    2. B

      A binary representation but no properties or behaviors

    3. C

      Only the class definition, without any individual properties

    4. D

      Its own name and its own list of courses based on the class definition

    Correct answer
    D

    Its own name and its own list of courses based on the class definition

    Explanation

    Each object created from the teacher class inherits the properties defined by the class, while holding values specific to that individual teacher.

  31. 31

    What does the example of a class object holding a teacher and assignments demonstrate?

    1. A

      Objects can contain references to other objects and interact through those relationships

    2. B

      Only graphical user interfaces can be represented as objects

    3. C

      Objects must remain completely independent and cannot refer to one another

    4. D

      A class and an object are always identical and cannot have different roles

    Correct answer
    A

    Objects can contain references to other objects and interact through those relationships

    Explanation

    The example shows a course object holding a teacher, students, and assignments, while those objects can also relate back to the course. This illustrates interacting object relationships.

  32. 32

    What is an integrated development environment, or IDE?

    1. A

      A program that combines tools for creating, running, testing, and building programs

    2. B

      A programming language designed solely for writing assembly instructions

    3. C

      A hardware component that stores only the binary form of an operating system

    4. D

      A user-interface device that replaces the computer's keyboard and monitor

    Correct answer
    A

    A program that combines tools for creating, running, testing, and building programs

    Explanation

    An IDE brings program writing, execution, testing, and application building into one software environment.

  33. 33

    How did development commonly work before integrated development environments became available?

    1. A

      Programmers avoided testing because text editors automatically detected every problem

    2. B

      Programmers used a basic text editor and manually ran separate execution and testing tools

    3. C

      Programmers used operating systems that automatically converted requirements into finished applications

    4. D

      Programmers wrote programs only by clicking graphical buttons in a unified environment

    Correct answer
    B

    Programmers used a basic text editor and manually ran separate execution and testing tools

    Explanation

    Before IDEs, programmers often wrote code in simple text editors and separately invoked compilers, interpreters, and testing programs.

  34. 34

    What is the function of a graphical user interface, or GUI?

    1. A

      It replaces the program's instructions with physical movements of the monitor

    2. B

      It translates all source code into binary without allowing user interaction

    3. C

      It lets users see and interact with a program through visual elements and input devices

    4. D

      It provides only a text-based terminal with no images or clickable controls

    Correct answer
    C

    It lets users see and interact with a program through visual elements and input devices

    Explanation

    A GUI uses visual elements on a display and devices such as a mouse, keyboard, or touchscreen to let users interact with a program.

  35. 35

    Which example represents GUI interaction on a smartphone?

    1. A

      Typing binary digits directly into the phone's processor

    2. B

      Tapping visual controls to launch or use an application

    3. C

      Running a program without viewing or interacting with any interface

    4. D

      Replacing the phone's operating system with a mechanical switch

    Correct answer
    B

    Tapping visual controls to launch or use an application

    Explanation

    A smartphone GUI provides visible controls that users can tap to run and interact with applications.

  36. 36

    How does a GUI relate to the program that provides it?

    1. A

      The GUI exists only before the program is written and disappears during execution

    2. B

      The GUI is the binary processor that executes every program instruction

    3. C

      The GUI is a component of the program created through program instructions

    4. D

      The GUI is always a separate physical device unrelated to the program

    Correct answer
    C

    The GUI is a component of the program created through program instructions

    Explanation

    A program includes instructions that create its graphical interface, making the GUI a component of the running program.

  37. 37

    What usually distinguishes an application from a program in the terminology used here?

    1. A

      An application is typically a program with a graphical user interface

    2. B

      An application is a binary instruction that cannot display visual elements

    3. C

      An application is always a smaller program with no user interaction

    4. D

      An application is a physical computer that runs several operating systems

    Correct answer
    A

    An application is typically a program with a graphical user interface

    Explanation

    The content uses “application” typically for a program with a GUI, such as software containing icons, images, and clickable controls.

  38. 38

    What is the primary workplace responsibility of a programmer?

    1. A

      To define a company's problems without creating or testing any software

    2. B

      To manufacture the physical components required by every computer system

    3. C

      To operate computers only through applications created by other people

    4. D

      To develop computer-based solutions to problems faced by a company or its users

    Correct answer
    D

    To develop computer-based solutions to problems faced by a company or its users

    Explanation

    A programmer creates computer solutions that may become part of a company's workflow, information system, or software product.

  39. 39

    What makes a programming solution general rather than specific?

    1. A

      It solves one example perfectly while ignoring other possible inputs

    2. B

      It addresses all relevant cases of a problem instead of only one set of values or one person

    3. C

      It focuses on the programmer's preferred case rather than the users' needs

    4. D

      It uses fixed values so that users cannot provide different information

    Correct answer
    B

    It addresses all relevant cases of a problem instead of only one set of values or one person

    Explanation

    Programmers aim to solve a class of problems across possible numerical values, people, and circumstances, rather than handling only one specific example.

  40. 40

    What should programmers do first in the described programming workflow?

    1. A

      Write code immediately without consulting potential users

    2. B

      Meet with the people who will use the program and understand their needs

    3. C

      Test a finished interface before deciding what the program should do

    4. D

      Deliver a final application before identifying the problem

    Correct answer
    B

    Meet with the people who will use the program and understand their needs

    Explanation

    The workflow begins by meeting with users to understand the problem, missing functionality, and requirements for the proposed solution.

  41. 41

    Why should a programmer plan a solution before writing code?

    1. A

      Planning clarifies the program's tasks and how each task should be solved

    2. B

      Planning guarantees that the program will never need testing or revision

    3. C

      Planning replaces the need to translate code into executable instructions

    4. D

      Planning allows the programmer to avoid understanding the users' problem

    Correct answer
    A

    Planning clarifies the program's tasks and how each task should be solved

    Explanation

    Planning helps programmers identify what the program must do and determine how to address each task before implementation begins.

  42. 42

    What does the term “cowboy coding” describe?

    1. A

      Writing highly optimized instructions in assembly language

    2. B

      Designing a GUI by arranging visual controls on a form

    3. C

      Testing a program repeatedly with users after each development iteration

    4. D

      Starting to write code without first planning how the solution should work

    Correct answer
    D

    Starting to write code without first planning how the solution should work

    Explanation

    Cowboy coding refers to jumping into coding without a deliberate plan, which can make it easy to lose direction.

  43. 43

    Which sequence best represents the main programming workflow described?

    1. A

      Code immediately, deliver, identify users, plan, and test only if problems appear

    2. B

      Build hardware, install an operating system, avoid testing, and release the program

    3. C

      Understand users and the problem, plan, code, test, revise if needed, and deliver

    4. D

      Test first, write requirements later, code, and deliver without user feedback

    Correct answer
    C

    Understand users and the problem, plan, code, test, revise if needed, and deliver

    Explanation

    The described workflow involves consulting users, understanding the problem, planning a solution, coding, testing, repeating when appropriate, and delivering the final product.

  44. 44

    What is the main purpose of alpha testing?

    1. A

      To verify internally that the program works correctly and does not crash

    2. B

      To determine whether external users like the program's solution

    3. C

      To translate the program from a human-readable language into binary

    4. D

      To identify which company should purchase the finished program

    Correct answer
    A

    To verify internally that the program works correctly and does not crash

    Explanation

    Alpha testing focuses on internal correctness, such as ensuring that the program was written properly and does not crash.

  45. 45

    What is the main purpose of beta testing?

    1. A

      To determine whether users find the program useful and whether it solves their needs

    2. B

      To verify only that the compiler can produce an executable file

    3. C

      To ensure that programmers can write every instruction in binary

    4. D

      To define the properties of objects before any program is created

    Correct answer
    A

    To determine whether users find the program useful and whether it solves their needs

    Explanation

    Beta testing involves users and evaluates whether the program is useful, acceptable, and actually addresses the problems they need solved.

  46. 46

    How does an Agile workflow differ from a more one-pass Software Development Life Cycle approach?

    1. A

      Agile uses short development bursts followed by testing, feedback, and repetition

    2. B

      Agile replaces testing with a compiler that automatically approves the program

    3. C

      Agile requires all planning and coding to happen only once without revision

    4. D

      Agile avoids users until the entire software product has been delivered

    Correct answer
    A

    Agile uses short development bursts followed by testing, feedback, and repetition

    Explanation

    The content contrasts a workflow with minimal repetition against Agile, which develops a short portion, tests it, gathers user feedback, and repeats the cycle.

  47. 47

    What is the broad significance of programming for computer use?

    1. A

      Programming removes the need for applications, operating systems, and user interfaces

    2. B

      Programming limits a computer to the capabilities built into its original hardware

    3. C

      Programming makes computers useful only for browsing and streaming media

    4. D

      Programming turns a computer into a flexible tool for creating solutions to problems

    Correct answer
    D

    Programming turns a computer into a flexible tool for creating solutions to problems

    Explanation

    Programming allows users to move beyond relying only on existing applications and create their own computer-based solutions.

Question 1 of 47
Question 1 of 47

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent