Computer Basics Quiz
48 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is a byte made up of?

  • 16 bits
  • 8 bits (correct)
  • 4 bits
  • 2 bits
  • What is commonly referred to as a word in computing?

  • A section of four bytes
  • A section of one byte
  • A section of two or four bytes (correct)
  • A section of eight bytes
  • Which of the following devices is considered a secondary storage device?

  • Keyboard
  • Monitor
  • Solid state drive (correct)
  • Mouse
  • Which of the following is NOT an input device?

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

    What is the main purpose of an operating system?

    <p>To manage hardware devices and control processes</p> Signup and view all the answers

    Which of the following is an example of a multitasking operating system?

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

    What technique do multitasking operating systems use to manage multiple programs?

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

    Which classification of software includes programs like Microsoft Word and Excel?

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

    What is the purpose of application software?

    <p>To make the computer useful for the user</p> Signup and view all the answers

    Which of the following is not considered application software?

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

    What role do algorithms play in computer programming?

    <p>They describe a set of well-defined steps to perform a task.</p> Signup and view all the answers

    Which statement accurately describes machine language?

    <p>It consists of binary numbers used to encode instructions.</p> Signup and view all the answers

    What was the first high-level programming language developed?

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

    How does a high-level programming language differ from machine language?

    <p>High-level languages are simpler for humans to understand.</p> Signup and view all the answers

    Which of the following types of software would be classified as application software?

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

    What is a defining characteristic of machine language instructions?

    <p>They consist of only two digits: 0 and 1.</p> Signup and view all the answers

    Which statement correctly identifies a common element found in most programming languages?

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

    What is the purpose of a key word in programming languages like Java?

    <p>To perform specific operations within the language</p> Signup and view all the answers

    In Java, how are statements typically terminated?

    <p>By using a semi-colon</p> Signup and view all the answers

    Which of the following is NOT a characteristic of Java key words?

    <p>They can be used as programmer-defined identifiers.</p> Signup and view all the answers

    What differentiates a line from a statement in Java source code?

    <p>A statement is a complete instruction, while a line may not represent a complete instruction.</p> Signup and view all the answers

    What role do variable names play in Java programming?

    <p>They represent a location in memory.</p> Signup and view all the answers

    Which programming language element is emphasized as case sensitive?

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

    Which of the following best describes a Java statement?

    <p>A complete instruction that causes an action to be performed.</p> Signup and view all the answers

    What is the purpose of a variable in programming?

    <p>It serves as a name for a specific memory location.</p> Signup and view all the answers

    What does the compiler do with a source code file?

    <p>It translates the source code into an executable form.</p> Signup and view all the answers

    What file extension do Java source code files have?

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

    Which of the following describes syntax errors?

    <p>Mistakes that violate the programming language's rules.</p> Signup and view all the answers

    In the provided example, what does the variable 'length' represent?

    <p>The memory location where the value is stored.</p> Signup and view all the answers

    Where does the Java Virtual Machine (JVM) decide to place the value of a variable?

    <p>In a memory address determined during runtime.</p> Signup and view all the answers

    What happens to the source code after compilation?

    <p>It is translated into machine code for execution.</p> Signup and view all the answers

    Which statement is true regarding the role of the compiler?

    <p>It enables the execution of source code by converting it into machine code.</p> Signup and view all the answers

    What does the command 'javac filename.java' do?

    <p>Compiles the Java source code file.</p> Signup and view all the answers

    Which of the following is not a step in the programming process?

    <p>Send the program to production.</p> Signup and view all the answers

    What is the purpose of the Java Development Kit (JDK)?

    <p>To write, compile, and debug Java programs.</p> Signup and view all the answers

    Which Java edition is aimed at enterprise-level applications?

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

    What should you do after entering the code and compiling it?

    <p>Correct any compilation errors.</p> Signup and view all the answers

    In which phase do software engineers check for logical errors in their models?

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

    Which task is not typically included in the responsibilities of software engineers?

    <p>Researching market trends</p> Signup and view all the answers

    What type of file does the Java compiler produce as output?

    <p>Byte code file</p> Signup and view all the answers

    What is the primary focus of object-oriented programming?

    <p>Creating objects rather than procedures</p> Signup and view all the answers

    What is meant by 'data hiding' in object-oriented programming?

    <p>Enabling objects to hide their internal states from other objects</p> Signup and view all the answers

    Which of the following is NOT a task performed by software engineers?

    <p>Designing user interface aesthetics</p> Signup and view all the answers

    What is an essential characteristic of an object in object-oriented programming?

    <p>It blends data and procedures to manipulate that data</p> Signup and view all the answers

    What role do methods play in an object?

    <p>They define behaviors that manipulate the object's data</p> Signup and view all the answers

    In the context of program development, what is a common approach used by software engineers for large applications?

    <p>Thoroughly analyzing program requirements and dividing them into subtasks</p> Signup and view all the answers

    Which of the following best describes a programming interface in object-oriented programming?

    <p>A method for objects to interact while controlling data access</p> Signup and view all the answers

    What is the purpose of using diagrams in software engineering?

    <p>To illustrate program components and data flow</p> Signup and view all the answers

    Study Notes

    Book Title and Edition

    • Starting Out with Java™ 7th Edition

    Chapter

    • Chapter 1: Introduction to Computers and Java

    Chapter Topics

    • Introduction
    • Why Program?
    • Computer Systems: Hardware and Software
    • Programming Languages
    • What is a program made of?
    • The Programming Process
    • Object-Oriented Programming

    Java History

    • 1991 - Green Team started by Sun Microsystems (now owned by Oracle)
    • 7 handheld controllers for multiple entertainment systems
    • Need for a programming language that runs on various devices
    • Java (first named Oak) developed for this purpose

    Introduction

    • Java enabled web browser (HotJava) demonstrated at 1995 Sun World conference
    • Java incorporated into Netscape shortly after
    • Java is cross-platform; meaning it can run on various computer operating systems

    Java Applications and Applets

    • Java programs can be of two types:
      • Applications
        • Stand-alone programs that run without the aid of a web browser
        • Relaxed security model since the user runs the program locally
      • Applets
        • Small applications that require the use of a Java enabled web browser to run
        • Enhanced security model since the user merely goes to a web page and the applet runs itself

    Why Program? (1 of 3)

    • Computers are tools that can be programmed to perform many functions, such as:
      • Spreadsheets
      • Databases
      • Games
      • Word processing
    • Computers versatile because they can be programmed
    • Computer programmers implement programs that perform these functions

    Why Program? (2 of 3)

    • Aspects of a computer program that must be designed:
      • Logical flow of instructions
      • Mathematical procedures
      • Layout of programming statements
      • Appearance of the screens
      • Way information is presented to the user
      • Program's "user friendliness"
      • Manuals, help systems, and documentation

    Why Program? (3 of 3)

    • Programs must be analytically correct.
    • Programs rarely work the first time.
    • Programmers must analyze, experiment, correct, and redesign programs continuously.
    • Programming languages have strict rules (syntax) that must be followed carefully.

    Computer Systems: Hardware (1 of 2)

    • Computer hardware components are the physical pieces of the computer
    • Major hardware components of a computer:
      • Central processing unit (CPU)
      • Main memory
      • Secondary storage devices
      • Input and output devices

    Computer Systems: Hardware (2 of 2)

    • Diagram illustrating the relationships between computer hardware components (Input, CPU, Memory, Storage, Output)

    Computer Systems: Hardware

    • Main Memory (1 of 3)
      • Commonly known as Random Access Memory (RAM)
      • RAM contains currently running programs, and data used by those programs
      • RAM is divided into units called bytes
      • A byte consists of eight bits that may be either on or off

    Computer Systems: Hardware

    • Main Memory (2 of 3)
      • A bit is either on or off
        • 1 = on , 0 = off
      • Bits form a pattern representing a character or number
      • Each byte in memory is assigned a unique number (address)
      • RAM is volatile; when the computer is turned off, the contents of RAM are erased

    Computer Systems: Hardware

    • Main Memory (3 of 3)
    • Main memory can be visualized as a column or row of cells
    • A section of memory is called a byte
    • A byte is made up of 8 bits
    • A section of two or four bytes is often called a word

    Computer Systems: Hardware

    • Secondary Storage Devices
    • Secondary storage devices are capable of storing information for longer periods (non-volatile)
    • Common storage devices:
      • Disk drive
      • External drive
      • CD drive
      • Solid state drive
      • USB drive
      • DVD drive

    Computer Systems: Hardware

    • Input Devices
    • Input is any data the computer collects from the outside world
    • Data comes from input devices
    • Common input devices:
      • Keyboard
      • Mouse
      • Scanner
      • Digital camera

    Computer Systems: Hardware

    • Output Devices
    • Output is any data the computer sends to the outside world
    • Data displayed on output devices
    • Common output devices:
      • Monitors
      • Printers
    • Some devices such as disk drives perform input and output, and are called I/O devices (input/output)

    Computer Systems: Software

    • Software refers to programs that run on a computer
    • Two classifications of software:
      • Operating Systems
      • Application Software

    Computer Systems: Software

    • Operating Systems (1 of 2)
    • An operating system is a set of programs that manages the computer's hardware devices and controls their processes.
    • Most modern operating systems are multitasking

    Computer Systems: Software

    • Operating Systems (2 of 2)
    • A multitasking operating system can run multiple programs at once
    • Techniques are called timesharing
    • A multitasking system divides the allocation of hardware resources and the attention of the CPU among all executing programs
      • Unix
      • Linux
      • MacOS
      • Windows

    Computer Systems: Software

    • Application Software
    • Application software makes the computer useful to the user
    • Application software provides a specialized environment for the user to work in
    • Common application software:
      • Spreadsheets
      • Word processors
      • Accounting software
      • Tax software
      • Games

    Programming Languages (1 of 5)

    • A program is a set of instructions a computer follows to perform a task.
    • A programming language is a special language used to write computer programs.
    • A computer program is a set of instructions that enable the computer to solve a problem or perform a task
    • Collectively, these instructions form an algorithm

    Programming Languages (2 of 5)

    • An algorithm is a set of well-defined steps to completing a task.
    • Steps in an algorithm are performed sequentially.
    • A computer needs the algorithm to be written in machine language.
    • Machine language is written using binary numbers.
    • The binary numbering system (base 2) only has two digits (0 and 1).

    Programming Languages (3 of 5)

    • Binary numbers are encoded as machine language
    • Each CPU has its own machine language
      • Motorola 68000 series processors
      • Intel x86 series processors
      • ARM processors, etc.
    • Example of a machine language instruction: 1011010000000101

    Programming Languages (4 of 5)

    • In the past, programmers wrote programs in machine language.
    • Programmers developed higher-level programming languages to make things easier
    • The first of these languages was assembler.
    • Assembler made things easier, but was also processor-dependent

    Programming Languages (5 of 5)

    • High-level programming languages followed, that were not processor dependent
    • Some common programming languages:
      • Java
      • BASIC
      • COBOL
      • Pascal
      • C
      • C++
      • C#
      • PHP
      • Visual Basic
      • Python
      • Ruby
      • JavaScript

    Programming Languages

    • Common Language Elements
    • Some concepts common to virtually all programming languages:
      • Keywords
      • Operators
      • Punctuation
      • Programmer-defined identifiers
      • Strict syntactic rules

    Programming Languages

    • Sample Program (1 of 2)
    • Sample Java code (public class HelloWorld)

    Programming Languages

    • Sample Program (2 of 2)
    • Key words in sample program: public, class, static, void
    • Key words are lower case (Java is case sensitive)
    • Key words cannot be used as programmer-defined identifiers
    • Semi-colons end Java statements, however not all lines end a statement.

    Programming Languages

    • Lines vs Statements
    • Differences between lines and statements when discussing source code
    • Example: System.out.println(message); ; one Java statement spread across two lines.
    • A statement is a complete instruction that causes the computer to perform an action.

    Programming Languages

    • Variables (1 of 3)
    • Data in a Java program is stored in memory
    • Variable names represent a location in memory
    • Variables in Java are sometimes called fields
    • Variables are created by the programmer using a programmer-defined identifier
    • Example: int hours = 40;

    Programming Languages

    • Variables (2 of 3)
    • Variables are simply a name given to represent a place in memory

    Programming Languages

    • Variables (3 of 3)
    • JVM (Java Virtual Machine) decides where the value will be placed in memory.

    The Compiler and the Java Virtual Machine (1 of 4)

    • Programmer writes Java programming statements for a program, known as source code.
    • A text editor is used to create and save the Java source code file.
    • Source code files have a .java extension.
    • A compiler is a program that translates source code into an executable form.

    The Compiler and the Java Virtual Machine (2 of 4)

    • A compiler is run using a source code file as input.
    • Syntax errors in the program are found during compilation.
    • Syntax errors are mistakes that violate the programming language rules.
    • The compiler creates another file containing translated instructions.

    The Compiler and the Java Virtual Machine (3 of 4)

    • Most compilers translate source code into executable files with machine code.
    • The Java compiler translates a Java source file into bytecode instructions.
    • Bytecode instructions are the machine language of the Java Virtual Machine (JVM).

    The Compiler and the Java Virtual Machine (4 of 4)

    • Bytecode files have a .class extension.
    • The JVM is a program that emulates a microprocessor.
    • The JVM executes instructions as they are read.
    • JVM is often called an interpreter.
    • Java is often referred to as an interpreted language.

    Program Development Process

    • Diagram showing the process of Java program development (text editor -> Save Java Statements -> Java compiler -> produces byte code -> JVM executes)

    Portability (1 of 3)

    • Portable means a program written on one type of computer can run on many computers with little modification.
    • Java bytecode runs on the JVM, not the CPU. Java programs are highly portable.
    • JVMs exist on many platforms
      • Windows
      • Unix
      • BSD
      • MacOS
      • Linux
      • etc.

    Portability (2 of 3)

    • With most programming languages, portability is achieved by compiling a program for each CPU it will run on.
    • Java provides a JVM (Java Virtual Machine) for each platform, so programmers don't need to recompile for different platforms.

    Portability (3 of 3)

    • Diagram showing bytecode (.class) running on multiple Java Virtual Machines for various platforms

    Java Versions

    • Java Development Kit (JDK) is used to write Java programs.
    • Different editions of JDK:
      • Java SE (Standard Edition)
      • Java EE (Enterprise Edition)
      • Java ME (Micro Edition)
    • Available for download at http://java.oracle.com

    Compiling a Java Program

    • The Java compiler is a command-line utility.
    • The command to compile a program is javac filename.java.
    • javac is the Java compiler.
    • The .java file extension must be used.

    The Programming Process (1 of 2)

    • Steps of the programming process
        1. Clearly define what the program is to do
        1. Visualize the program running on the computer
        1. Use design tools to create a model of the program.
        1. Check the model for logical errors

    The Programming Process (2 of 2)

    • Steps of the programming process
        1. Enter the code and compile it
        1. Correct any errors found during compilation
        1. Run the program with test data for input
        1. Correct any runtime errors found while running the program
        1. Validate the results of the program

    Software Engineering (1 of 3)

    • Encompasses the whole process of crafting computer software
    • Software engineers perform several tasks in developing complex software projects:
      • Designing
      • Writing
      • Testing
      • Debugging
      • Documenting
      • Modifying
      • Maintaining

    Software Engineering (2 of 3)

    • Software engineers develop:
      • Program specifications
      • Diagrams of screen output
      • Diagrams representing program components and the flow of data
      • Pseudocode
      • Examples of expected input and desired output

    Software Engineering (3 of 3)

    • Software engineers use special software designed for testing programs.
    • Most commercial software applications are large and complex.
    • Usually a team of programmers, not a single individual, develops them.
    • Program requirements are thoroughly analyzed and divided into subtasks handled by individuals within a team.

    Object-Oriented Programming (1 of 4)

    • Object-oriented programming is centered on creating objects rather than procedures.
    • Objects are a combination of data and procedures (methods) that manipulate that data.
    • Data in an object are called attributes
    • Procedures in an object are called methods.

    Object-Oriented Programming (2 of 4)

    • Diagram showing an object with attributes (data) and methods (procedures/behaviors)

    Object-Oriented Programming (3 of 4)

    • Object-oriented programming combines data and behavior via encapsulation
    • Data hiding is the ability of an object to hide data from other objects in the program.
    • Only methods of an object should be able to directly manipulate its attributes
    • Other objects can manipulate attributes via an object's methods.
    • This indirect access is a programming interface

    Object-Oriented Programming (4 of 4)

    • Diagram showing an object with attributes (data) and methods (procedures/behaviors) and a programming interface enabling other objects to interact indirectly.

    Studying That Suits You

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

    Quiz Team

    Related Documents

    Description

    Test your knowledge on fundamental computer concepts, including data storage, operating systems, and software types. This quiz covers essential questions about bytes, input and output devices, and programming languages. Perfect for beginners and students in computer science.

    More Like This

    Use Quizgecko on...
    Browser
    Browser