Computer Basics Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (D)</p> Signup and view all the answers

What is the main purpose of an operating system?

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

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

<p>Unix (A)</p> Signup and view all the answers

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

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

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

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

What is the purpose of application software?

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

Which of the following is not considered application software?

<p>Assembler (B)</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. (B)</p> Signup and view all the answers

Which statement accurately describes machine language?

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

What was the first high-level programming language developed?

<p>Assembler (A)</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. (D)</p> Signup and view all the answers

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

<p>Spreadsheet software (B)</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. (A)</p> Signup and view all the answers

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

<p>Key words (A)</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 (B)</p> Signup and view all the answers

In Java, how are statements typically terminated?

<p>By using a semi-colon (C)</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. (C)</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. (C)</p> Signup and view all the answers

What role do variable names play in Java programming?

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

Which programming language element is emphasized as case sensitive?

<p>Key words (D)</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. (C)</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. (A)</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. (C)</p> Signup and view all the answers

What file extension do Java source code files have?

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

Which of the following describes syntax errors?

<p>Mistakes that violate the programming language's rules. (A)</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. (C)</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. (A)</p> Signup and view all the answers

What happens to the source code after compilation?

<p>It is translated into machine code for execution. (B)</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. (A)</p> Signup and view all the answers

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

<p>Compiles the Java source code file. (A)</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. (D)</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. (C)</p> Signup and view all the answers

Which Java edition is aimed at enterprise-level applications?

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

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

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

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

<p>Designing (B)</p> Signup and view all the answers

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

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

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

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

What is the primary focus of object-oriented programming?

<p>Creating objects rather than procedures (C)</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 (C)</p> Signup and view all the answers

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

<p>Designing user interface aesthetics (A)</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 (B)</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 (B)</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 (A)</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 (B)</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 (C)</p> Signup and view all the answers

Flashcards

Byte

A section of memory that represents a single unit of data, typically 8 bits.

Bit

A group of 8 consecutive bits, representing a single unit of information.

Word

Two or four bytes grouped together, typically used for storing larger data values.

Secondary Storage Devices

Devices that store information persistently, even after the computer is turned off.

Signup and view all the flashcards

Input Devices

Devices that allow the computer to receive information from the outside world.

Signup and view all the flashcards

Output Devices

Devices that allow the computer to display or send information to the outside world.

Signup and view all the flashcards

Operating System

A program that manages the computer's hardware resources and controls processes.

Signup and view all the flashcards

Multitasking Operating System

A type of operating system that can run multiple programs simultaneously.

Signup and view all the flashcards

Application Software

Programs that make a computer useful for users, providing a specialized environment for tasks like spreadsheets, word processing, and accounting.

Signup and view all the flashcards

Computer Program

A set of instructions that a computer follows to perform a task, written in a specialized language designed for computers.

Signup and view all the flashcards

Programming Language

A specific language used to write instructions for a computer to understand and follow.

Signup and view all the flashcards

Algorithm

A well-defined set of steps for completing a task, where each step is performed in sequence.

Signup and view all the flashcards

Machine Language

The language that computers directly understand, using binary numbers (0s and 1s) to represent instructions.

Signup and view all the flashcards

High Level Programming Language

A programming language that makes it easier for programmers to write code by allowing them to use more human-readable instructions.

Signup and view all the flashcards

Assembler

The first type of high-level programming language that made it easier to write computer programs.

Signup and view all the flashcards

Keywords

Reserved words with specific meanings in a programming language, like 'public', 'class', and 'void' in Java.

Signup and view all the flashcards

Operators

Symbols used to perform operations, such as + for addition, - for subtraction, and * for multiplication.

Signup and view all the flashcards

Punctuation

Special characters that define the structure of a program, like semicolon (;), curly brackets ({}), and parenthesis (()).

Signup and view all the flashcards

Programmer-defined Identifiers

Names chosen by programmers to represent variables, functions, classes, etc., like 'message' in a Java program.

Signup and view all the flashcards

Strict Syntactic Rules

Rules that dictate the syntax of a programming language, ensuring code is structured correctly and understandable by the computer.

Signup and view all the flashcards

Statement

A complete instruction that tells the computer to perform a specific action.

Signup and view all the flashcards

Variables

Locations in computer memory that store data. They are represented by programmer-defined identifiers in Java.

Signup and view all the flashcards

Case-sensitive

A programming language that is case-sensitive means that upper and lowercase letters are treated differently. For example, 'HelloWorld' and 'helloWorld' are considered different identifiers.

Signup and view all the flashcards

Variable declaration

An instruction that assigns a value to a variable.

Signup and view all the flashcards

Compiler

A program that translates source code into an executable form.

Signup and view all the flashcards

Syntax errors

Mistakes in the code that violate programming language rules.

Signup and view all the flashcards

Java Virtual Machine (JVM)

A program that runs on top of a computer's operating system, providing a virtual environment for Java programs to execute.

Signup and view all the flashcards

Source code

The human-readable instructions written by a programmer in a programming language.

Signup and view all the flashcards

Executable file

A file containing a set of instructions in machine-readable format.

Signup and view all the flashcards

What is an object in object-oriented programming?

A melding of data and procedures that manipulate that data.

Signup and view all the flashcards

What are attributes?

Data within an object.

Signup and view all the flashcards

What are methods?

Procedures within an object.

Signup and view all the flashcards

What is data hiding?

The ability of an object to hide data from other objects. This ensures that only its own methods can directly access its data.

Signup and view all the flashcards

What is a programming interface?

The way other objects can interact with an object's attributes. It involves using only the object's methods to access its data.

Signup and view all the flashcards

What are program specifications?

A software engineer's description outlining what a program should do.

Signup and view all the flashcards

What are flowcharts?

Diagrams representing the program's components and the flow of data.

Signup and view all the flashcards

What is pseudocode?

A step-by-step process written in plain language, not code. These help developers understand the program's logic.

Signup and view all the flashcards

Java SE (Standard Edition)

The standard version of the Java programming language, typically used for desktop applications and general-purpose programming.

Signup and view all the flashcards

Java EE (Enterprise Edition)

An edition of Java designed for enterprise-level applications, often used for creating web applications, services, and large-scale systems.

Signup and view all the flashcards

Java ME (Micro Edition)

A lightweight version of Java optimized for resource-constrained devices like mobile phones and embedded systems.

Signup and view all the flashcards

Java Compilation

The process of transforming Java source code (.java files) into bytecode (.class files) that can be executed by the Java Virtual Machine (JVM).

Signup and view all the flashcards

The Programming Process

A set of steps involved in developing a computer program, encompassing planning, designing, writing, testing, and debugging.

Signup and view all the flashcards

Software Engineering

A branch of computer science focusing on the design, development, and maintenance of software systems.

Signup and view all the flashcards

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

More Like This

Use Quizgecko on...
Browser
Browser