What does a Java compiler do quizlet?

Recommended textbook solutions

What does a Java compiler do quizlet?

Python for Everyone

2nd EditionCay S. Horstmann, Rance D. Necaise

730 solutions

What does a Java compiler do quizlet?

Python for Everyone

1st EditionCay S. Horstmann, Rance D. Necaise

633 solutions

What does a Java compiler do quizlet?

Python for Everyone

2nd EditionCay S. Horstmann, Rance D. Necaise

730 solutions

What does a Java compiler do quizlet?

Python for Everyone Interactive Edition

2nd EditionCay S. Horstmann, Rance D. Necaise

730 solutions

Recommended textbook solutions

What does a Java compiler do quizlet?

Introduction to Algorithms

3rd EditionCharles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

726 solutions

What does a Java compiler do quizlet?

Information Technology Project Management: Providing Measurable Organizational Value

5th EditionJack T. Marchewka

346 solutions

What does a Java compiler do quizlet?

Fundamentals of Database Systems

7th EditionRamez Elmasri, Shamkant B. Navathe

687 solutions

What does a Java compiler do quizlet?

Introduction to Autocad 2017

1st EditionJim Fitzgerald, Paul Richard

476 solutions

Home

Subjects

Expert solutions

Create

Log in

Sign up

Upgrade to remove ads

Only SGD 41.99/year

  • Flashcards

  • Learn

  • Test

  • Match

  • Flashcards

  • Learn

  • Test

  • Match

Introduction to Computers and Java

Terms in this set (64)

Why is the computer used by so many different people, in so many different professions?

Because the computer can be programmed to do so many different tasks.

List the five major hardware components of a computer system.

The Central Processing Unit (CPU), main memory, secondary storage devices, input devices, output devices.

Internally, the CPUc onsists of what two units?

Arithmetic and Logic Unit (ALU), and Control Unit

Describe the steps in the fetch/decode/executecycle.

Fetch: The CPU's control unit fetches the program's next instruction from main memory.
Decode: The control unit decodes the instruction, which is encoded in the form of a number. An electrical signal is generated.
Execute: The signal is routed to the appropriate component of the computer, which causes a device to perform an operation.

What is a memory address? What is its purpose?

A unique number assigned to each section of memory. The address is used to identify a location in memory.

Explain why computers have both main memory and secondary storage.

Program instructions and data are stored in main memory while the program is operating. Main memory is volatile, and loses its contents when power is removed from the computer. Secondary storage holds data for long periods of time—even when there is no power to the computer.

What does the term multitasking mean?

It means that an operating system is capable of running multiple programs at once.

Describe the difference between a key word and a programmer-defined symbol.

A key word has a special purpose, and is defined as part of a programming language. A programmer-defined symbol is a word or name defined by the programmer.

Describe the difference between operators and punctuation symbols.

Operators perform operations on one or more operands. Punctuation symbols mark the beginning or ending of a statement, or separates items in a list.

Describe the difference between a program line and a statement.

A line is a single line as it appears in the body of a program. A statement is a complete instruction that causes the computer to perform an action.

Why are variables called "variable"?

Because their contents may be changed.

What happens to a variable's current contents when a new value is stored there?

The original value is overwritten.

What is a compiler?

A compiler is a program that translates source code into an executable form.

What is a syntax error?

Syntax errors are mistakes that the programmer has made that violate the rules of the programming language. These errors must be corrected before the compiler can translate the source code.

What is byte code?

The Java compiler translates Java source code into byte code, which is an intermediate language. The Java Virtual Machine executes the byte code instructions.

What is the JVM?

The Java Virtual Machine (JVM) is a program that reads Java byte code instructions and executes them as they are read. In other words, it interprets byte code instructions. You can think of the JVM as a program that simulates a computer whose machine language is Java byte code.

What four items should you identify when defining what a program is to do?

The program's purpose, input, process, and output.

What does it mean to "visualize a program running"? What is the value of such an activity?

Before you create a program on the computer, it is often a good idea to imagine what the computer screen will look like while the program is running. If it helps, draw pictures of the screen, with sample input and output, at various points in the program.

What is pseudocode?

A cross between human language and a programming language. Pseudocode is especially helpful when designing an algorithm. Although the computer can't understand pseudocode, programmers often find it helpful to write an algorithm in a language that's "almost" a programming language, but still very similar to natural language.

Describe what a compiler does with a program's source code.

A compiler translates source code into an executable form.

What is a runtime error?

A runtime error is an error that occurs while the program is running. These are usually logical errors, such as mathematical mistakes.

Is a syntax error (such as misspelling a keyword) found by the compiler or when the program is running?

Syntax errors are found by the compiler.

What is the purpose of testing a program with sample data or input?

You can provide sample data and predict what the output should be. If the program does not produce the correct output, a logical error is present in the program.

In procedural programming, what two parts of a program are typically separated?

Data and the code that operates on the data.

What are an object's attributes?

The data contained in an object.

What are an object's methods?

The procedures, or behaviors, that an object performs.

What is encapsulation?

Encapsulation refers to the combining of data and code into a single object.

What is data hiding?

Data hiding refers to an object's ability to hide its data from code that is outside the object. Only the object's methods may then directly access and make changes to the object's data. An object typically hides its data, but allows outside code to access the methods that operate on the data.

This part of the computer fetches instructions, carries out the operations commanded by the instructions, and produces some outcome or resultant information.

CPU

A byte is made up of eight

bits

Each byte is assigned a unique

address

This type of memory can hold data for long periods of time—even when there is no power to the computer.

secondary storage

If you were to look at a machine language program, you would see _________.

a stream of binary numbers

This type of program is designed to be transmitted over the Internet and run in a Web browser.

applet

These are words that have a special meaning in the programming language.

key words

These characters serve specific purposes, such as marking the beginning or ending of a statement, or separating items in a list.

punctuation

These are words or names that are used to identify storage locations in memory and parts of the program that are created by the programmer.

programmer-defined names

These are the rules that must be followed when writing a program.

syntax

This is a named storage location in the computer's memory.

variable

These are symbols or words that perform operations on one or more operands.

operators

The Java compiler generates __________.

byte code

JVM stands for __________.

Java Virtual Machine

1. Both main memory and secondary storage are types of memory. Describe the difference between the two.

Main memory, or RAM, holds the sequences of instructions in the programs that are running and the data those programs are using. Main memory, or RAM, is usually volatile. Secondary storage is a type of memory that can hold data for long periods of time—even when there is no power to the computer.

2. What type of memory is usually volatile?

Main memory RAM

3. What is the difference between operating system software and application software?

An operating system is a set of programs that manages the computer's hardware devices and controls their processes. Windows and UNIX are examples of operating systems. Application software refers to programs that make the computer useful to the user. These programs solve specific problems or perform general operations that satisfy the needs of the user. Word processing, spreadsheet, and database packages are all examples of application software.

4. Why must programs written in a high-level language be translated into machine language before they can be run?

Because the computer only understand machine language.

5. Why is it easier to write a program in a high-level language than in machine language?

Because machine language programs are streams of binary numbers, and high level language programs are made up of words.

6. What is a source file?

a text listing of commands to be compiled or assembled into an executable computer program.

7. What is the difference between a syntax error and a logical error?

Syntax errors are mistakes that the programmer has made that violate the rules of the programming language. Logical errors are mistakes that cause the program to produce erroneous results.

8. What is an algorithm?

An algorithm is a set of well-defined steps for performing a task or solving a problem.

9. What is a compiler?

A program that translates source code into executable code.

10. What is the difference between an application and an applet?

An application is a stand-alone program that runs on your computer. An applet is designed to be transmitted over the Internet from a Web server, and then executed in a Web browser

11. Why are Java applets safe to download and execute?

Because the browser executes them in a restricted environment.

12. What must a computer have in order for it to execute Java programs?

Java Virtual Machine (JVM).

13. What is the difference between machine language code and byte code?

Machine language code is executed directly by the CPU. Byte code is executed by the JVM.

14. Why does byte code make Java a portable language?

Because Javabyte code is the same on all computers, compiled Java programs are highly portable. In fact,
a compiled Java program may be run on any computer that has a JVM.

15. Is encapsulation a characteristic of procedural or object-oriented programming?

Object-oriented programming

16. Why should an object hide its data?

Data hiding ensures exclusive data access to class members and protects object integrity by preventing unintended or intended changes.

17. What part of an object forms an interface through which outside code may access the object's data?

The object's methods.

18. What type of program do you use to write Java source code?

You can use any text editor to create and edit source files.

19. Will the Java compiler translate a source file that contains syntax errors?

No

20. What does the Java compiler translate Java source code to?

the compiler will translate it to byte code.

21. Assuming you are using the JDK, what command would you type at the operating system command prompt to compile the program LabAssignment.java?

javac LabAssignment.java

22. Assuming there are no syntax errors in the LabAssignment.java program when it is compiled, answer the following questions.
a. What file will be produced?
b. What will the file contain?
c. What command would you type at the operating system command prompt to run the program?

a. LabAssignment.class
b. byte code
c. java LabAssignment

Sets found in the same folder

Chapter 9 Text Processing and More about Wrapper C…

83 terms

dung_nguyen6180

Chapter 9 Text Processing and More about Wrapper C…

27 terms

dung_nguyen6180

Chapter 8 Second Look at Classes and Objects (Read…

51 terms

dung_nguyen6180

Chapter 10 Inheritance (Reading)

110 terms

dung_nguyen6180

Other sets by this creator

Regex

39 terms

dung_nguyen6180

Chapter 3 Parallel and Perpendicular Lines

29 terms

dung_nguyen6180

Chapter 2 Use Inductive Reasoning

14 terms

dung_nguyen6180

Chapter 1: Essentials of Geometry

35 terms

dung_nguyen6180

Verified questions

computer science

Write a program that uses a structure to store the following weather data for a particular month: Total Rainfall High Temperature Low Temperature Average Temperature The program should have an array of 12 structures to hold weather data for an entire year. When the program runs, it should ask the user to enter data for each month. (The average temperature should be calculated.) Once the data are entered for all the months, the program should calculate and display the average monthly rainfall, the total rainfall for the year, the highest and lowest temperatures for the year (and the months they occurred in), and the average of all the monthly average temperatures. Input Validation: Only accept temperatures within the range between –100 and +140 degrees Fahrenheit.

Verified answer

computer science

This is a feature of OOP that wraps data attributes and its relevant methods in a bundle. a. polymorphism b. inheritance c. encapsulation d. abstraction

Verified answer

computer science

True/False. Java is an assembly language.

Verified answer

computer science

T F The programmer must know in advance how many nodes will be needed in a linked list.

Verified answer

Recommended textbook solutions

What does a Java compiler do quizlet?

Information Technology Project Management: Providing Measurable Organizational Value

5th EditionJack T. Marchewka

346 solutions

What does a Java compiler do quizlet?

Service Management: Operations, Strategy, and Information Technology

7th EditionJames Fitzsimmons, Mona Fitzsimmons

103 solutions

What does a Java compiler do quizlet?

Computer Organization and Design MIPS Edition: The Hardware/Software Interface

5th EditionDavid A. Patterson, John L. Hennessy

220 solutions

What does a Java compiler do quizlet?

Fundamentals of Database Systems

7th EditionRamez Elmasri, Shamkant B. Navathe

687 solutions

Other Quizlet sets

Womens Health Exam 2

21 terms

Madison_Jones4408

CDCs Set 1 Vol. 2: Pharmacy Administration

129 terms

Kate_Maynard22

Pain Management Rationale

34 terms

krobinson203PLUS

Pediatric GI

21 terms

nurselaura98

What is the function of a compiler quizlet?

Compiler translates high level source program into a equivalent target program (machine language). language more or less one at a time, executing them as it goes along.

Why compiler is used in Java?

A compiler in Java translates the entire source code into a machine-code file or any intermediate code, and that file is then executed. It is platform-independent. A bytecode is basically an intermediate code generated by the compiler after the compilation of its source code.

What is a compiler quizlet?

compiler. a program that translates a high=level language into machine language, then saves the machine language so that the instructions do not have to be translated each time the program is run.

Which compiler is used in Java?

javac - Java programming language compiler.