IST 140 FINAL REVIEW

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Evaluate the pseudocode below to calculate the payment (pmt) with the following test values: The total number of hours worked (workingHours) = 60 The rate paid for hourly work (rate) = 15 Input workingHours Input rate pmt = workingHours * rate If workingHours > 40 then extraHours = workingHours - 40 extraPmt = extraHours * rate * 2 pmt = pmt + extraPmt Output pmt 900 1,200 1,500 1,800

1,500

In the code snippet below, which line contains a syntax error: 1 public class AddOne{ 2 public static void main(String[] args){ 3 int count = 0; 4 count = count + 1 5 } 6}

4

While developing a program, the programmer adds the discount amount to the total due instead of subtracting it. What type of error is this? A syntax error A logic error A hardware error A compile-time error

A logic error

Which of the following are reasons why Java is good, but not perfect for beginners? I. A certain amount of technical machinery is necessary to write basic, simple programs II. There are many extensions III. There are a large number of extensive libraries in Java I, II only I, III only II, III only I, II, III

I, III only

Which statements are true? I. In Java, a file can contain at most one public class II. The word public denotes that the class is useable by the "public" III. Every Java program must have a main method I, II only I, III only II, III only I, II, III

I, III only

Which one of the following typically provides data persistence without electricity? I. The CPU's memory II. The hard disk III. Secondary storage I, II only I, III only II, III only I, II, III

II, III only

Consider the following statements about computer programs: I. Computer programs can be written by someone who has a basic knowledge of operating a computer. II. Computer programs can complete complex tasks quickly. III. Large and complex computer programs are generally written by a group of programmers. IV. Computer programs are composed of extremely primitive operations. Which one of the following options is correct? II and III only are the correct statements. I, II, III, and IV are correct statements. II, III, and IV only are correct statements. I and IV only are correct statements.

II, III, and IV only are correct statements.

Java is said to be a "safe" programming language. What does this mean? Java programs cannot cause environmental damage because they are "green". Java programs can run within a browser without fear that they may attack your computer. There is no way for a Java program to read or write a file. Java programs cannot access data across a computer network.

Java programs can run within a browser without fear that they may attack your computer.

An example of an output device that interfaces between computers and humans is a keyboard. a mouse. a speaker. a microphone.

a speaker.

What is the term used to describe a sequence of instructions that solve a problem? output input algorithm process

algorithm

In order for Java to achieve portability compiled Java programs contain instructions for a virtual machine Java is not compiled Java programs must be re-compiled on each platform where they are to run Java programs are based on the C++ programming language

compiled Java programs contain instructions for a virtual machine

In order to translate a Java program to a class file, the computer needs to have software called a(n): assembler virtual machine compiler debugger

compiler

The Java statement public static void main(String[] args) declares a ____________. class variable constant method

method

Which of the following statements must you include in a Java class that can be executed by the virtual machine? System.out.println(); // Hello public static void main(String[] args) return 0;

public static void main(String[] args)

The source code for a Java program is stored in a file that ends with a .class suffix that can have any valid file name that ends with a .java suffix that has no suffix

that ends with a .java suffix

During program development, errors are very rare prevented by the compiler automatically tracked by the Integrated Development Environment (IDE) unavoidable

unavoidable

What symbol(s) is used to surround a block of code inside the main method? "" [] {} ()

{}

Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers? Efficiency and portability Safety and security Safety and portability Efficiency and security

Safety and portability

Which of the following refers to a collection of programs that a computer executes? Software Assembler Instructions Source code

Software

What kind of error is created by the following code snippet? System.outt.println("Hello"); No error: this code is correct Logic error: the program will run until it comes to this statement Syntax error: the program will not compile Exception: the statement will generate an exception

Syntax error: the program will not compile

Imagine you are planning to purchase a new cable TV dish. You are considering two cable TV dishes that have different purchase prices. Each channel service provider charges a different rate for each month that the cable TV dish is used. To determine which cable TV dish is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cable TV dish. What are all of the inputs that you need for this algorithm? The cost of each cable TV dish and the rate for each month for using each cable TV dish. The cost of each cable TV dish and the number of months provided with each cable TV dish. The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months provided with each cable TV dish. The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months you would use the cable TV dish.

The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months you would use the cable TV dish.

These two lines of code do not produce the same output. Why? System.out.println(7 + 3); System.out.println("7 + 3"); Arithmetic calculations cannot take place within the println method call. In fact, the two statements do produce the same output. The quotes cause the second expression to be treated as a string. Because there are no escape characters.

The quotes cause the second expression to be treated as a string.

The term "applet" refers to a Java program a Java program that runs as a C++ program a Java program that runs within an Integrated Development Environment (IDE) a Java program that runs within a web browser

a Java program that runs within a web browser


Kaugnay na mga set ng pag-aaral

Introduction to Psychology Chapter 1 section 3

View Set

restorative art - bones of the face and cranium

View Set

BIO 1314 - Chapter 15 - The Autonomic Nervous System

View Set

Chapter 24: Asepsis and Infection Control PrepU

View Set