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

Study methods

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

Introduction to Programming Languages

  • 77Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Programming Basics

What is a programming language?

77 questions

  1. 1

    What is a programming language?

    Model answer

    A programming language is a language used to communicate instructions to a computer or other digital device.

    Explanation

    Just as people use languages such as English to communicate with one another, programmers use programming languages to communicate with machines.

  2. 2

    Why is a programming language needed to operate a computer?

    Model answer

    A computer cannot work independently; it needs instructions, and a programming language provides a way to communicate those instructions.

    Explanation

    Computers perform tasks only when they receive suitable instructions expressed in a language they can process.

  3. 3

    What is an algorithm?

    Model answer

    An algorithm is a set of rules or a sequence of steps used to perform a specific task.

    Explanation

    Algorithms provide the ordered instructions needed to solve a problem or complete an operation.

  4. 4

    How are programming languages related to algorithms?

    Model answer

    Programming languages provide the rules and structures used to express algorithms for a computer.

    Explanation

    A program communicates an algorithm to a computer by representing its instructions in a programming language.

  5. 5

    What are the two main parts of a programming language?

    Model answer

    The two main parts are syntax and semantics.

    Explanation

    Syntax concerns how instructions are written, while semantics concerns what those instructions mean.

  6. 6

    What is syntax in a programming language?

    Model answer

    Syntax is the structure or set of rules that determines how commands and other elements must be written.

    Explanation

    Syntax includes aspects such as word arrangement, punctuation, and other structural requirements.

  7. 7

    What is semantics in a programming language?

    Model answer

    Semantics is the meaning produced by a syntactically correct command or statement.

    Explanation

    Syntax determines the form of an instruction, while semantics determines what that instruction communicates to the computer.

  8. 8

    State the formal definition of a programming language given in the content.

    Model answer

    A programming language is a vocabulary and set of grammatical rules for instructing a computer or computing device to perform a specific task.

    Explanation

    Each programming language has its own keywords and syntax for organizing program instructions.

  9. 9

    What are keywords in a programming language?

    Model answer

    Keywords are reserved words that belong to a programming language and help organize or express program instructions.

    Explanation

    Each programming language has a unique set of keywords and special syntax.

  10. 10

    What type of signals can a computer understand?

    Model answer

    A computer understands electrical signals represented as high and low signals.

    Explanation

    Computers are electronic devices, so their basic instructions are represented through electrical states.

  11. 11

    How are high and low electrical signals represented in a computer?

    Model answer

    A high-voltage signal is represented by 111, and a low-voltage signal is represented by 000.

    Explanation

    The two electrical states form the binary system used by computers.

  12. 12

    What are binary digits?

    Model answer

    Binary digits are the digits 000 and 111 used to represent low- and high-voltage signals.

    Explanation

    Computers use combinations of these two digits to represent instructions and data.

  13. 13

    What is machine language?

    Model answer

    Machine language is a programming language consisting of combinations of binary digits that a computer can understand directly.

    Explanation

    Because machine language uses the computer's basic electrical representations, it does not need translation before execution.

  14. 14

    Why does machine language not require a translator?

    Model answer

    Machine language does not require a translator because the computer's processor understands its binary instructions directly.

    Explanation

    Translation is needed for languages that are written in forms other than machine code.

  15. 15

    When was first-generation machine-level programming language used?

    Model answer

    It was used approximately from 194019401940 to 195919591959.

    Explanation

    This generation was associated with early computers, including vacuum-tube computers and early transistor computers.

  16. 16

    Which types of computers were programmed using first-generation machine language?

    Model answer

    It was used with first-generation vacuum-tube computers and early versions of transistor computers.

    Explanation

    These early systems were programmed directly with binary machine instructions.

  17. 17

    What was one major performance advantage of machine-language programs?

    Model answer

    Machine-language programs were generally very fast because the computer could understand them directly.

    Explanation

    No translation stage was required between the program and the processor.

  18. 18

    Why were machine-language programs lengthy?

    Model answer

    Every instruction had to be expressed using binary digits, so even simple tasks required many symbols.

    Explanation

    Representing all operations as combinations of 000 and 111 made programs long.

  19. 19

    Why was machine language difficult for programmers to understand?

    Model answer

    Binary coding is difficult to read and interpret, so it was not easily understandable to most programmers.

    Explanation

    The lack of meaningful words or symbols made machine code complex and error-prone for humans.

  20. 20

    Why was machine language not portable?

    Model answer

    Machine code depended on the specific hardware and coding of a computer, so a program for one machine could not generally run on another.

    Explanation

    Programmers had to write different machine code for different computers.

  21. 21

    Why was programming in machine language time-consuming?

    Model answer

    Writing lengthy binary instructions for every operation required considerable time.

    Explanation

    The complexity of binary coding made even simple programs laborious to create.

  22. 22

    What led to the development of assembly language?

    Model answer

    Assembly language was developed because programmers needed a language that was easier to write and understand than machine language.

    Explanation

    The difficulty and inefficiency of writing long binary programs created the need for symbolic instructions.

  23. 23

    What is assembly language?

    Model answer

    Assembly language is a second-generation programming language that uses symbolic representations called mnemonics instead of binary instructions.

    Explanation

    Mnemonics make program instructions more readable and easier to write than sequences of 000 and 111.

  24. 24

    When was second-generation assembly language used?

    Model answer

    It was used approximately from 195919591959 to 196519651965.

    Explanation

    Assembly language followed machine language as an improvement in the evolution of programming languages.

  25. 25

    What are mnemonics?

    Model answer

    Mnemonics are symbolic representations used in assembly language to represent machine instructions or operations.

    Explanation

    They make assembly code easier for programmers to write and understand.

  26. 26

    How did assembly language improve programming compared with machine language?

    Model answer

    It was easier to understand and write, reduced errors, and required less time for coding.

    Explanation

    Its symbolic instructions replaced difficult binary representations.

  27. 27

    Why does assembly language require an assembler?

    Model answer

    A computer cannot understand assembly language directly, so an assembler must convert it into machine language.

    Explanation

    The processor can execute the resulting machine code, not the original symbolic assembly instructions.

  28. 28

    What is an assembler?

    Model answer

    An assembler is a program that translates assembly-language source code into machine-level object code.

    Explanation

    The translated object code can be directly executed by the processor.

  29. 29

    Why can assembly-language programs take longer to run than machine-language programs?

    Model answer

    Assembly code must first be converted into machine code by an assembler, adding translation time.

    Explanation

    Machine-language programs can execute directly without this conversion step.

  30. 30

    Why was assembly language still not portable?

    Model answer

    Assembly language remained machine-dependent, so code written for one computer generally could not run on another computer.

    Explanation

    Its instructions were tied to the hardware and instruction set of a particular machine.

  31. 31

    What problem caused the development of third-generation languages?

    Model answer

    The machine dependence of machine and assembly languages made it impractical to write separate programs for the growing number of computers.

    Explanation

    A more portable language was needed so that programs could run on different machines with little or no modification.

  32. 32

    What are the first two generations of programming languages collectively called?

    Model answer

    The first and second generations are called low-level languages.

    Explanation

    Machine language and assembly language are close to the computer's hardware.

  33. 33

    When were third-generation programming languages developed?

    Model answer

    Third-generation programming languages were developed in approximately 196519651965 and continue to be used.

    Explanation

    They were introduced to provide greater portability and ease of programming than low-level languages.

  34. 34

    What is the main portability advantage of third-generation languages?

    Model answer

    A program written on one computer can usually run on another computer without modification or with only minor modifications.

    Explanation

    This machine independence made third-generation programs portable.

  35. 35

    How do third-generation languages make programming easier?

    Model answer

    They use English words for variables, programming structures, and commands, reducing the difficulty of learning and writing programs.

    Explanation

    Their more human-readable notation is easier than binary or symbolic machine-oriented code.

  36. 36

    What is structured programming?

    Model answer

    Structured programming divides a large program into smaller sections, with each section performing a specific related task.

    Explanation

    Breaking a program into functional sections makes large programs easier to organize and manage.

  37. 37

    Why are third-generation languages called programmer-friendly languages?

    Model answer

    They are called programmer-friendly because they are portable, use understandable English-based commands, and support structured programming.

    Explanation

    These features make programs easier to learn, write, and organize.

  38. 38

    Which languages were among the first third-generation programming languages?

    Model answer

    FORTRAN, ALGOL, and COBOL were among the first third-generation programming languages.

    Explanation

    These languages used English-like words and were more machine-independent than earlier generations.

  39. 39

    Why are third-generation languages also called high-level languages?

    Model answer

    They are called high-level languages because they use English words and are relatively distant from the hardware.

    Explanation

    Their human-readable structure contrasts with the binary and symbolic forms of low-level languages.

  40. 40

    What is a disadvantage of third-generation languages related to execution?

    Model answer

    They require translation into machine language, so the translation process can make program execution time-consuming.

    Explanation

    The computer cannot execute the high-level source code directly.

  41. 41

    Name four modern examples of third-generation programming languages.

    Model answer

    Examples include C, C++, C#, and Java.

    Explanation

    These languages use higher-level, human-readable programming constructs.

  42. 42

    How do fourth-generation languages differ from third-generation languages in their use of English?

    Model answer

    Fourth-generation languages use more common English-like syntax and phrases, whereas third-generation languages use a more limited set of English words.

    Explanation

    The broader English-like form makes fourth-generation languages more accessible to nonprogrammers.

  43. 43

    Who can generally access or use fourth-generation languages?

    Model answer

    They are accessible to people without formal training as programmers.

    Explanation

    Their English-like syntax and high-level operations make them more programmer-friendly.

  44. 44

    How do fourth-generation languages simplify commands?

    Model answer

    A single programmer-entered command can perform multiple common operations.

    Explanation

    This allows programmers to express complex tasks with fewer instructions.

  45. 45

    What kinds of information do fourth-generation languages process efficiently?

    Model answer

    They can operate on large collections of information at once rather than focusing only on individual bits and bytes.

    Explanation

    This makes them suitable for data-oriented tasks.

  46. 46

    List four applications of fourth-generation languages.

    Model answer

    They are used for database management, report generation, mathematical optimization, GUI development, and web development.

    Explanation

    Their ability to process large amounts of information supports these applications.

  47. 47

    What does it mean that fourth-generation languages are nonprocedural?

    Model answer

    They specify what task should be performed while leaving the method of performing it to the language.

    Explanation

    The programmer states the desired result rather than describing every implementation step.

  48. 48

    What is a limitation of fourth-generation languages regarding programmer control?

    Model answer

    Because the language carries out much of the task automatically, the programmer has limited control over the program and system resources.

    Explanation

    Automation improves ease of use but reduces direct control.

  49. 49

    What are two resource disadvantages of fourth-generation language packages?

    Model answer

    They can be lengthy and therefore require more disk space and greater memory capacity.

    Explanation

    Their high-level features and automated operations increase resource requirements.

  50. 50

    Name four commonly used fourth-generation languages.

    Model answer

    Examples include SQL, NATURAL, M-POWER, and LANSA.

    Explanation

    These languages are designed for high-level, often data-oriented operations.

  51. 51

    What idea led to the development of fifth-generation programming languages?

    Model answer

    The idea was that computers should solve particular problems without direct help from the programmer.

    Explanation

    Fifth-generation languages aim to shift more problem-solving responsibility from the programmer to the computer.

  52. 52

    Where and when was the concept of fifth-generation programming languages introduced?

    Model answer

    The concept was first introduced in Japan in the early 199019901990s.

    Explanation

    It is now regarded as a future-oriented approach to programming.

  53. 53

    How do fifth-generation languages differ from fourth-generation languages?

    Model answer

    Fourth-generation languages build specific programs, while fifth-generation languages aim to enable computers to solve given problems with minimal programmer assistance.

    Explanation

    Fifth-generation programming focuses on problem conditions rather than having the programmer specify an implementation routine or algorithm.

  54. 54

    What must a user specify when using a fifth-generation language?

    Model answer

    The user specifies the problem to be solved and the conditions that must be met, without specifying how to implement the solution.

    Explanation

    The language or automated system determines the method of solving the problem.

  55. 55

    What is a major application of fifth-generation programming languages?

    Model answer

    They are used mainly in artificial intelligence research.

    Explanation

    Their goal of automated problem solving makes them suitable for artificial intelligence applications.

  56. 56

    Why are fifth-generation languages complicated and resource-intensive?

    Model answer

    Their automated systems make development and maintenance more complicated and require additional resources for effective operation.

    Explanation

    Greater automation and problem-solving capability increase system complexity and resource demands.

  57. 57

    Give two examples of fifth-generation programming languages.

    Model answer

    OPS5 and MERCURY are examples of fifth-generation programming languages.

    Explanation

    Both are associated with the goal of automated or logic-based problem solving.

  58. 58

    Which generations are collectively called high-level languages?

    Model answer

    The third, fourth, and fifth generations are collectively called high-level languages.

    Explanation

    These generations use forms that are more understandable to humans and less dependent on hardware.

  59. 59

    Compare low-level and high-level languages in terms of machine dependence.

    Model answer

    Low-level languages are machine-dependent, whereas high-level languages are machine-independent.

    Explanation

    Low-level code is closely tied to specific hardware, while high-level code is designed to be portable across systems.

  60. 60

    Compare the notation used by low-level and high-level languages.

    Model answer

    Low-level languages use binary digits or symbolic mnemonics, whereas high-level languages use English words and phrases.

    Explanation

    The notation of high-level languages is generally more readable and accessible to programmers.

  61. 61

    Compare the portability of low-level and high-level programs.

    Model answer

    Low-level programs are generally not portable, while high-level programs can usually run on different computers with no or only minor modifications.

    Explanation

    High-level languages hide many hardware-specific details.

  62. 62

    Compare how low-level and high-level programs interact with hardware.

    Model answer

    Low-level programs can interact directly with system hardware, whereas high-level programs cannot interact with hardware directly.

    Explanation

    High-level programs require translation and other system layers before the hardware can execute them.

  63. 63

    Compare the difficulty of learning and implementing low-level and high-level languages.

    Model answer

    Low-level languages are difficult to learn and implement, whereas high-level languages are easier to learn and implement.

    Explanation

    High-level languages use more human-readable words and abstractions.

  64. 64

    Why were language translators developed?

    Model answer

    They were developed because computers understand only machine language, while programmers needed easier languages for writing long and complex programs.

    Explanation

    Translators convert human-oriented source code into machine code that computers can execute.

  65. 65

    What is a language translator?

    Model answer

    A language translator is a program that converts source code written in a programming language into machine code, also called object code.

    Explanation

    The resulting object code allows the computer to implement the original program.

  66. 66

    What other terms refer to language translators?

    Model answer

    Language translators are also called translators or language processors.

    Explanation

    These terms describe programs that convert source code into a form the computer can execute.

  67. 67

    What are the three main types of language translators?

    Model answer

    The three main types are assemblers, compilers, and interpreters.

    Explanation

    Each translator converts source code, but assemblers, compilers, and interpreters work with different languages or translation methods.

  68. 68

    What is the input and output of an assembler?

    Model answer

    An assembler takes assembly-language source code as input and produces machine-language object code as output.

    Explanation

    The object code can be directly executed by the processor.

  69. 69

    What does a compiler do?

    Model answer

    A compiler translates source code, generally from a high-level language, into machine code.

    Explanation

    It translates the entire program before execution.

  70. 70

    What does an interpreter do?

    Model answer

    An interpreter converts source code from a programming language into machine language one statement at a time.

    Explanation

    Unlike a compiler, it does not translate the entire program as one unit before execution.

  71. 71

    How does a compiler process a program?

    Model answer

    A compiler scans and translates the entire program into machine code as a whole before the program is executed.

    Explanation

    This whole-program translation generally results in less execution time than statement-by-statement interpretation.

  72. 72

    How does an interpreter process a program?

    Model answer

    An interpreter translates and executes the program statement by statement.

    Explanation

    Repeated translation during execution increases the overall time required to run the program.

  73. 73

    Why does a compiled program generally execute faster than an interpreted program?

    Model answer

    A compiler translates the entire program before execution, while an interpreter translates statements during execution.

    Explanation

    Pre-translation avoids the repeated statement-by-statement translation overhead of an interpreter.

  74. 74

    When does a compiler report errors?

    Model answer

    A compiler generally reports errors after scanning the entire program.

    Explanation

    The compiler analyzes the whole source program before completing its translation process.

  75. 75

    How does an interpreter respond to an error?

    Model answer

    An interpreter translates until it encounters the first error, then stops execution.

    Explanation

    It processes statements sequentially, so an error interrupts the process at the point where it is found.

  76. 76

    Which translation method is associated with C and C++?

    Model answer

    C and C++ generally use a compiler.

    Explanation

    Their source code is translated into machine code as a whole before execution.

  77. 77

    Which translation method is associated with Python and Ruby?

    Model answer

    Python and Ruby generally use an interpreter.

    Explanation

    Their programs are translated and executed statement by statement according to the content.

1 of 77
Question 1 of 77

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent