• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 39 pages
Exam (elaborations)

CS 170 Midterm || All Correct.

Document preview thumbnail
Preview 4 out of 39 pages

Q1. Software or programs, are generally stored on your hard or fixed disk, but are run by loading them: A. into your network adapter B. into secondary storage C. onto the CPU D. into main memory correct answers D. into main memory Q1 The devices that feed data and programs into computers are called ____. A. input devices B. output devices C. monitors D. printers correct answers A. input devices Devices like keyboards, mice and scanners, which your program uses to receive information, are called input devices. Q1 Which of the following is NOT part of the central processing unit? A. instruction register B. main memory C. program counter D. control unit correct answers B. main memory Q1 Programs that are designed to "work for you", carring out a task you specify, are known as: A. system programs B. operating systems C. utility software D. application programs correct answers D. application programs Q1 Each memory cell has a unique location in main memory, called the ____. A. unique identifier B. ID C. address D. cell location correct answers C. address Q1 When a Java string does not have surrounding double quotes, what type of error occurs? A. Logic error B. Run-time error C. Compile-time error D. Linker error correct answers C. Compile-time error Q1 In the DrJava IDE, you can evaluate and try out fragments of Java code without writing an entire program in the: A. Interactions Pane B. Interpreter Pane

Content preview

CS 170 Midterm || All Correct.
Q1. Software or programs, are generally stored on your hard or fixed disk, but are run by loading
them:
A. into your network adapter
B. into secondary storage
C. onto the CPU
D. into main memory correct answers D. into main memory

Q1 The devices that feed data and programs into computers are called ____.
A. input devices
B. output devices
C. monitors
D. printers correct answers A. input devices

Devices like keyboards, mice and scanners, which your program uses to receive information, are
called input devices.

Q1 Which of the following is NOT part of the central processing unit?
A. instruction register
B. main memory
C. program counter
D. control unit correct answers B. main memory

Q1 Programs that are designed to "work for you", carring out a task you specify, are known as:
A. system programs
B. operating systems
C. utility software
D. application programs correct answers D. application programs

Q1 Each memory cell has a unique location in main memory, called the ____.
A. unique identifier
B. ID
C. address
D. cell location correct answers C. address

Q1 When a Java string does not have surrounding double quotes, what type of error occurs?
A. Logic error
B. Run-time error
C. Compile-time error
D. Linker error correct answers C. Compile-time error

Q1 In the DrJava IDE, you can evaluate and try out fragments of Java code without writing an
entire program in the:
A. Interactions Pane
B. Interpreter Pane

,C. Snippets Pane
D. Definitions Pane correct answers A. Interactions Pane. Definitions Pane is where you write
your code.

Q1 What is the computer component that stores program instructions during a program
execution?
A. Hard disk
B. Memory
C. DVD drive
D. Input correct answers B.Memory

Q1 Text, like everything else in your computer, is stored as raw binary numbers. To treat those
numbers as characters, they must be encoded. The encoding scheme used in Java is called:
A. EBCDIC
B. RSA
C. Unicode
D. SHA-256 correct answers C. Unicode

EBCDIC is a character encoding scheme, but not the one used in Java, which is Unicode.

Q1 If your Java source code program compiles, but displays an error message when you run it,
then it must have a:
A. spelling error
B. syntax error
C. runtime error
D. logic error correct answers C. runtime error

Q2 The elements inside the class body are surrounded with, or delimited by:
A. single-quotes
B. brackets [ ]
C. braces { }
D. double-quotes correct answers C. braces {}

Q2 Which of these must appear outside the body of a class?
A. variable definitions
B. comments
C. import statements
D. output statements correct answers C. import statements

Q2 In a main method definition, the symbols appearing inside the () are called the:
A. modifier
B. parameter list
C. access specifier
D. method return type correct answers B. parameter list

Q2 Which of these is a legal (that is, syntactically correct) Java identifier?

,A. U2
B. bo-Tox
C. 2LiveCrew
D. moo tunes correct answers A. U2

While letters, digits and underscores are legal in identifiers, you cannot start with a digit. You
also cannot have spaces or hyphens in an identifier. That leaves only U2.
identifiers can start with S signs or _ as well.

Q2 Which of these words that can appear in a Java program are identifiers?
A. static
B. public
C. void
D. out correct answers D. out

Only out is an identifier. void, public and static are all keywords that you've used in your
programs.

Q2A(n) ___________________ is a program that converts assembly language or high-level
language statements into machine code at the time the program runs.
A. interpreter
B. assembler
C. linker
D. compiler correct answers A. interpreter

A compiler converts an entire program to machine language. An interpreter converts your
program on a line-by-line basis while program runs. This resolved portability & translation
issues. An assembler is used to convert assembly to machine language for CPU to understand, it
needed to be written everytime for a new computer.

Q2 The early high-level programming language designed as a general-purpose numeric and
scientific programming language, and one which had a significant influence on the procedural
languages that we use today was named ___________________
A. Algol
B. LISP
C. COBOL
D. FORTRAN correct answers D. FORTRAN

fortran = scientists & engineers
cobol = buisness
LISP = math
algol - arithmetic for general purpouse

Q2 Method definitions should be placed:
A. inside the body of your class
B. after the class it is used in

, C. inside the Java class library
D. before the class it is used in correct answers A. inside the body of your class

method definition = (String[] args)

Q2 Here is a portion of the source code for a computer program:

69 6D 70 6F 72 74 20 6A-61 76 61 2E 61 77 74 2E
2A 3B 0D 0A 69 6D 70 6F-72 74 20 6A 61 76 61 2E
61 77 74 2E 65 76 65 6E-74 2E 2A 3B 0D 0A 69 6D

This program is an example of _____________________________.
A. high-level language
B. hard-coded language
C. assembly language
D. machine language correct answers D. machine language

Machine language is the numerical code that your CPU is programmed to respond to. Assembly
language is more english type of code used for people to understand.

Q2 Which of these identifiers follows the Java conventions (not just the syntax rules) for a
constant name?
A. TotalCost
B. TOTAL_COST
C. totalCost
D. total_cost correct answers B. TOTAL_COST

By convention, constants are all CAPS_WITH_UNDERSCORES separating the words.

Q3 The statement System.out.print("No" + 2 + 3 + "way"); produces the output:
A. No5way
B. No23way
C. None. Illegal statement.
D. No 2 3 way correct answers B. No23way

The concatenation "pastes" the 2 onto the end of "No" before the 3 could be added. The the 3 is
concatenated onto the result.

Q3 In a variable definition, the kind of value stored inside is called its:
A. type
B. name
C. initial value
D. modifier correct answers A. type. Variables are named storage area that holds a value. Syntax
of variable= modifier type name = intial value; int x =2; x = type where value is stored

Q3 To join two String objects together, use the __________ operator.

Document information

Uploaded on
March 25, 2025
Number of pages
39
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.19

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SirAnton
3.7
(118)
Sold
811
Followers
438
Items
40316
Last sold
1 week ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions