zyBooks Chapter 1 Flashcards
81 Questions
100 Views

zyBooks Chapter 1 Flashcards

Created by
@LavishDiopside625

Questions and Answers

What is a bit?

  • A type of processor
  • 0s and 1s, binary digits (correct)
  • A program
  • A memory unit
  • What are processors?

    Circuits that execute a list of desired calculations (instructions).

    Where are instructions stored?

    Memory

    What is memory?

    <p>A circuit that can store 0s and 1s.</p> Signup and view all the answers

    Instructions operate on _________, which is also stored in _______________ locations as 0s and 1s.

    <p>data, memory</p> Signup and view all the answers

    Chef ( ) executes instructions of a recipe ( ), each instruction modifying ingredients ( ), with the recipe and ingredients kept on a nearby counter ( ).

    <p>processor, program, data, memory</p> Signup and view all the answers

    What is a sequence of instructions?

    <p>Program, application (app)</p> Signup and view all the answers

    What are machine instructions?

    <p>Instructions written in binary.</p> Signup and view all the answers

    What is an executable program?

    <p>Sequence of machine instructions.</p> Signup and view all the answers

    What do assemblers/assembly language instructions do?

    <p>Automatically converts human instructions into machine instructions.</p> Signup and view all the answers

    When were high-level languages created?

    <p>60s and 70s.</p> Signup and view all the answers

    What do high-level languages do?

    <p>Support programming using formulas or algorithms.</p> Signup and view all the answers

    What are compilers?

    <p>Programs that automatically translate high-level languages into executable programs (machine instructions).</p> Signup and view all the answers

    To run a program on multiple processor types: the programmer must have the compiler generate multiple ____________.

    <p>executables</p> Signup and view all the answers

    How does Java run on different processor types?

    <p>The compiler generates an executable (bytecode) using the machine language of a 'program', and the real processor runs a virtual machine that executes the instructions in the bytecode.</p> Signup and view all the answers

    Sometimes running things on a virtual processor makes execution __________.

    <p>slower</p> Signup and view all the answers

    What used to be a job title?

    <p>Computer</p> Signup and view all the answers

    What is software?

    <p>Computer's programs.</p> Signup and view all the answers

    What is hardware?

    <p>What runs the programs.</p> Signup and view all the answers

    What are input/output devices commonly called?

    <p>Peripherals</p> Signup and view all the answers

    What does a disk (hard drive) do?

    <p>Stores files and other data; non-volatile.</p> Signup and view all the answers

    What is non-volatile memory?

    <p>Maintain their contents even when powered off.</p> Signup and view all the answers

    What is flash storage?

    <p>Non-volatile, tunnels electrons into special circuits on memory's chip, then removes them with a flash of electricity.</p> Signup and view all the answers

    What is RAM (random-access memory)?

    <p>Holds data read from storage; more expensive than disk; RAM is volatile.</p> Signup and view all the answers

    One byte = ________.

    <p>8 bits</p> Signup and view all the answers

    What does the processor do?

    <p>Runs the computer's programs, reading and executing instructions from memory.</p> Signup and view all the answers

    What does BIOS stand for?

    <p>(Basic input/output system)</p> Signup and view all the answers

    What does the processor execute?

    <p>Operating system.</p> Signup and view all the answers

    What are processors also known as?

    <p>CPUs (central processing unit) or microprocessors.</p> Signup and view all the answers

    What is cache memory?

    <p>A small amount of RAM on a processor chip; helps with speed.</p> Signup and view all the answers

    What does a processor's clock do?

    <p>Ticks at a specific frequency that determines the rate of the instructions being executed.</p> Signup and view all the answers

    How do programs actually run "simultaneously"?

    <p>They're being alternated between depending on the clock, switching off thousands of times per second.</p> Signup and view all the answers

    What are transistors?

    <p>Smaller switches made a long time ago which were integrated onto a single chip (integrated circuit/IC).</p> Signup and view all the answers

    What is Moore's Law?

    <p>The doubling of IC capacity about every 18 months.</p> Signup and view all the answers

    What are cores?

    <p>The processors in IC transistors.</p> Signup and view all the answers

    When was the first C book written?

    <ol start="1978"> <li></li> </ol> Signup and view all the answers

    Who wrote the first C book and where?

    <p>Kernighan and Ritchie at AT&amp;T Bell Labs.</p> Signup and view all the answers

    What was the dominant programming language in the 80s and 90s?

    <p>C.</p> Signup and view all the answers

    When was the first book about C++ written?

    <ol start="1985"> <li></li> </ol> Signup and view all the answers

    Who created C++?

    <p>Stroustrup.</p> Signup and view all the answers

    What was different about C++?

    <p>Supported object-oriented programming.</p> Signup and view all the answers

    When was Java first released to the public and from where?

    <p>1995, Sun Microsystems.</p> Signup and view all the answers

    Java is NOT...

    <p>JavaScript.</p> Signup and view all the answers

    A computer program consists of instructions that a computer...

    <p>Executes.</p> Signup and view all the answers

    What is code?

    <p>Textual representation of a program.</p> Signup and view all the answers

    What is a line?

    <p>A row of text.</p> Signup and view all the answers

    What is main?

    <p>A program starts by executing a method called main.</p> Signup and view all the answers

    What is a method?

    <p>A list of statements.</p> Signup and view all the answers

    What do { and } denote in programming?

    <p>A list of statements.</p> Signup and view all the answers

    What is a statement?

    <p>A program instruction; usually appears on its own line.</p> Signup and view all the answers

    Every program statement ends with...

    <p>A semicolon.</p> Signup and view all the answers

    What is the return statement?

    <p>A statement that ends a program.</p> Signup and view all the answers

    What is a variable?

    <p>A named location in memory.</p> Signup and view all the answers

    What do print statements do?

    <p>Print a program's output.</p> Signup and view all the answers

    What does println print?

    <p>Output followed by a new line.</p> Signup and view all the answers

    What is a compiler?

    <p>A tool that converts a program into low-level machine instructions (0s and 1s) understood by a particular computer.</p> Signup and view all the answers

    What is a comment in programming?

    <p>Text added to code by a programmer, ignored by the compiler.</p> Signup and view all the answers

    What does a single-line comment use?

    <p>//</p> Signup and view all the answers

    Multi-line comment uses __________.

    <p>/**/ or /* */</p> Signup and view all the answers

    Where do single-line comments commonly appear?

    <p>After a statement on the same line.</p> Signup and view all the answers

    Is a multi-line comment allowed on a single line?

    <p>But don't do it lol.</p> Signup and view all the answers

    What is a multi-line comment also known as?

    <p>Block comment.</p> Signup and view all the answers

    What is whitespace?

    <p>Blank spaces between items within a statement, blank lines between statements; compilers ignore most whitespace.</p> Signup and view all the answers

    What is the good practice with whitespace?

    <p>Use is to make a program more readable.</p> Signup and view all the answers

    What do programmers usually follow?

    <p>Conventions defined by their company, team, instructor, etc.</p> Signup and view all the answers

    What is a style guide?

    <p>A programming team's style for writing code.</p> Signup and view all the answers

    _______ style for braces and indents is named after C language creators.

    <p>K&amp;R</p> Signup and view all the answers

    __________ style for braces and indents is named after C++ language creator.

    <p>Stroustrup</p> Signup and view all the answers

    What is a syntax error?

    <p>Violate a programming language's rules on how symbols can be combined to create a program.</p> Signup and view all the answers

    Are misleading error messages common?

    <p>Yes.</p> Signup and view all the answers

    What is good practice for error messages?

    <p>Focus on fixing just the first error reported by the compiler, then re-compiling.</p> Signup and view all the answers

    What is good practice while coding?

    <p>Compiling after writing only a few lines of code.</p> Signup and view all the answers

    Where might the actual error be in a program?

    <p>Lines previous to the one being reported as having an error.</p> Signup and view all the answers

    What are compile-time errors?

    <p>Errors detected by the compiler, like syntax errors.</p> Signup and view all the answers

    A program can successfully compile, meaning there's no ___________________________________ but it may not run because of _____________________.

    <p>compile-time errors, logic errors</p> Signup and view all the answers

    What are logic errors?

    <p>Errors that occur while a program runs.</p> Signup and view all the answers

    What is a warning in programming?

    <p>A compiler will sometimes report a warning; doesn't stop the compiler from creating an executable program, but it indicates a possible logic error.</p> Signup and view all the answers

    What do only errors do?

    <p>Prevent a program from being created, not warnings.</p> Signup and view all the answers

    What is better: writing code that generates no warnings?

    <p>Yes.</p> Signup and view all the answers

    What do default settings commonly do?

    <p>Do NOT report all important issues.</p> Signup and view all the answers

    What is good practice in configuring a compiler?

    <p>Good practice is to explicitly configure the compiler to report most warnings.</p> Signup and view all the answers

    Study Notes

    Computer Basics

    • A bit represents the smallest unit of data, consisting of 0s or 1s.
    • Processors are circuits that execute a series of calculations and instructions.
    • Instructions are stored in memory, which is a circuit capable of storing bits.

    Memory and Data

    • Memory stores data as binary digits (0s and 1s).
    • Instructions act on data, which is also stored in memory.
    • A program is a sequence of instructions, analogous to a recipe executed by a processor.

    Instruction Formats

    • Machine instructions are encoded in binary format.
    • An executable program is a set sequence of machine instructions ready for execution.
    • Assemblers convert human-readable instructions into machine instructions.

    Programming Languages

    • High-level programming languages emerged in the 1960s and 70s, designed to enhance programming efficiency through formulas and algorithms.
    • Compilers convert high-level language code into executable machine instructions.

    Java and Portability

    • Java enables the creation of applications that can run across different processor types using bytecode.
    • The Java compiler generates an executable version of a program as bytecode, which runs on a virtual machine.

    Hardware Overview

    • Hardware includes all physical components that run programs, while software refers to the programs themselves.
    • I/O devices such as monitors and mice are part of peripherals that facilitate user interaction.

    Storage Types

    • Disk drives are non-volatile storage devices that retain data when powered off.
    • Flash storage transfers electrons through circuits to maintain data non-volatile.
    • RAM (random-access memory) temporarily holds data and is volatile, losing contents when powered off.

    Processing and Execution

    • A processor executes the operating system, allowing for the running of applications and interfacing with peripherals.
    • Cache memory enhances processing speed by storing frequently used data on the processor chip.

    Programming Fundamentals

    • Programming utilizes variables, which are named memory locations storing data.
    • A program runs by starting with a main method, where execution begins.
    • Each program statement must end with a semicolon.

    Comments and Code Readability

    • Comments help programmers document their code and are ignored by compilers.
    • Whitespace is used to separate code elements and improve readability, but compilers generally ignore it.

    Good Coding Practices

    • Following conventions and a style guide enhances code clarity and maintainability.
    • Syntax errors arise from violations of programming rules, whereas logic errors occur during program execution.

    Compiler Feedback

    • Compilers report compile-time errors, preventing the creation of executable programs, whereas warnings indicate potential issues but do not halt compilation.
    • It is advised to configure compilers to report most warnings to improve code quality.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your understanding of key terms in Chapter 1 of zyBooks. This set of flashcards covers essential concepts including bits, processors, and memory, crucial for grasping the fundamentals of computer science. Boost your learning by reviewing these terms and their definitions.

    More Quizzes Like This

    Computer Science Concepts Terminology Quiz
    10 questions
    History of Computer Science Terminology
    10 questions
    Computer Science 120 Terms
    26 questions

    Computer Science 120 Terms

    StatuesquePrimrose avatar
    StatuesquePrimrose
    Use Quizgecko on...
    Browser
    Browser