All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
starting out with java from control structures
Questions and Answers of
Starting Out With Java From Control Structures
What type of memory is usually volatile?
1. Use a text editor to type the source code exactly as it is shown. Be sure to place all the punctuation characters and be careful to match the case of the letters as they are shown. Save it to a
A byte is made up of eighta. CPUsb. Addressesc. Variablesd. Bits
List the five major hardware components of a computer system.
The following are programs expressed as English statements. What would each display on the screen if they were actual programs?1. The variable x starts with the value 0.The variable y starts with the
What is the difference between operating system software and application software?
Because there are many Java IDEs, we cannot include specific instructions for all of these. The following are general steps that should apply to most of them. You will need to consult your IDE’s
Each byte is assigned a uniquea. Addressb.CPUc. Bitd. Variable
Internally, the CPU consists of what two units?
Why must programs written in a high-level language be translated into machine language before they can be run?
This type of memory can hold data for long periods of time—even when there is no power to the computer.a. RAMb. Primary storagec. Secondary storaged. CPU storage
Describe the steps in the fetch/decode/execute cycle.
Why is it easier to write a program in a high-level language than in machine language?
If you were to look at a machine language program, you would see _________.a. Java source codeb. A stream of binary numbersc. English wordsd. Circuits
What is a memory address? What is its purpose?
What is a source file?
This type of program is designed to be transmitted over the Internet and run in a Web browser.a. Applicationb. Appletc. Machine languaged. Source code
Explain why computers have both main memory and secondary storage.
What is the difference between a syntax error and a logical error?
These are words that have a special meaning in the programming language.a. Punctuationb. Programmer-defined namesc. Key wordsd. Operators
What does the term multitasking mean?
What is an algorithm?
These are symbols or words that perform operations on one or more operands.a. Punctuationb. Programmer-defined namesc. Key wordsd. Operators
Describe the difference between a key word and a programmer-defined symbol.
What is a compiler?
These characters serve specific purposes, such as marking the beginning or ending of a statement, or separating items in a list.a. Punctuationb. Programmer-defined namesc. Key wordsd. Operators
Describe the difference between operators and punctuation symbols.
What is the difference between an application and an applet?
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.a. Punctuationb. Programmer-defined namesc. Key wordsd.
Describe the difference between a program line and a statement.
Why are Java applets safe to download and execute?
These are the rules that must be followed when writing a program.a. Syntaxb. Punctuationc. Key wordsd. Operators
Why are variables called “variable”?
What must a computer have in order for it to execute Java programs?
This is a named storage location in the computer’s memory.a. Classb. Key wordc. Variabled. Operator
What happens to a variable’s current contents when a new value is stored there?
What is the difference between machine language code and byte code?
The Java compiler generates __________.a. Machine codeb. Byte codec. Source coded. HTML
What is a compiler?
Why does byte code make Java a portable language?
JVM stands for __________.a. Java Variable Machineb. Java Variable Methodc. Java Virtual Methodd. Java Virtual Machine
What is a syntax error?
Is encapsulation a characteristic of procedural or object-oriented programming?
What is byte code?
Why should an object hide its data?
What is the JVM?
What four items should you identify when defining what a program is to do?
What part of an object forms an interface through which outside code may access the object’s data?
What does it mean to “visualize a program running”? What is the value of such an activity?
What type of program do you use to write Java source code?
What is pseudocode?
Will the Java compiler translate a source file that contains syntax errors?
Describe what a compiler does with a program’s source code.
What does the Java compiler translate Java source code to?
What is a runtime error?
Assuming you are using the JDK, what command would you type at the operating system command prompt to compile the program LabAssignment.java?
Is a syntax error (such as misspelling a key word) found by the compiler or when the program is running?
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
What is the purpose of testing a program with sample data or input?
In procedural programming, what two parts of a program are typically separated?
What are an object’s attributes?
What are an object’s methods?
What is encapsulation?
What is data hiding?
The following program will not compile because the lines have been mixed up. public static void main(String[] args)}// A crazy mixed up programpublic class Columbus{System.out.println("In 1492
Every complete statement ends with a __________.a. Periodb. Parenthesisc. Semicolond. Ending brace
Show how the double variables temp, weight, and age can be declared in one statement.
Is the following comment a single-line style comment or a multi-line style comment?/* This program was written by M. A. Codewriter */
Write a program that declares the following:• A String variable named name• An int variable named age• A double variable named annual PayStore your age, name, and desired annual income as
The following data72'A'"Hello World" 2.8712Are all examples of __________.a. Variablesb. Literalsc. Stringsd. None of these
There are a number of syntax errors in the following program. Locate as many as you can. */ What's wrong with this program? /*public MyProgram{ public static void main(String[]
Show how the int variables months, days, and years may be declared in one statement, with months initialized to 2 and years initialized to 3.
Is the following comment a single-line style comment or a multi-line style comment?// This program was written by M. A. Codewriter
Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first, middle, and last names. The program should also have the following char
Complete the following program skeleton so it displays the message “Hello World” on the screen.public class Hello{ public static void main(String[] args) { // Insert code here to
A group of statements, such as the contents of a class or a method, are enclosed in __________.a. Braces {}b. Parentheses ()c. Brackets []d. Any of these will do
Write assignment statements that perform the following operations with the variables a, b, and c.a. Adds 2 to a and stores the result in bb. Multiplies b times 4 and stores the result in ac. Divides
Describe what the phrase “self-documenting program” means.
Write a program that displays the following information, each on a separate line:• Your name• Your address, with city, state, and ZIP• Your telephone number• Your college majorAlthough these
On paper, write a program that will display your name on the screen. Place a comment with today’s date at the top of the program. Test your program by entering, compiling, and running it.
Which of the following are not valid assignment statements? (Indicate all that apply.)a. Total = 9;b. 72 = amount;c. Profit = 129d. Letter = 'W';
What is meant by “case-sensitive”?s Why is it important for a programmer to know that Java is a case-sensitive language?
Write a program that displays the following pattern: * *** ***** ******* ***** *** *
All Java source code filenames must end with __________.a) A semicolonb) .Classc) .javad) None of the above
Which of the following are not valid println statements? (Indicate all that apply.)a. System.out.println + "Hello World";b. System.out.println("Have a nice day");c. Out.System.println(value);d.
How would each of the following numbers be represented in E notation? a. 3.287 × 106b. −9.7865 × 1012c. 7.65491 × 10−3
Briefly explain how the print and println methods are related to the System class and the out object.
The East Coast sales division of a company generates 62 percent of total sales. Based on that percentage, write a program that will predict how much the East Coast division will generate if the
Every Java application program must have __________.a) A method named mainb) More than one class definitionc) One or more comments
The negation operator is __________.a. Unaryb. Binaryc. Ternaryd. None of these
Modify the following program so it prints two blank lines between each line of text. public class{ public static void main(String[] args) { System.out.print("Hearing in the
What does a variable declaration tell the Java compiler about a variable?
One acre of land is equivalent to 43,560 square feet. Write a program that calculates the number of acres in a tract of land with 389,767 square feet. Hint: Divide the size of the tract of land by
This key word is used to declare a named constant.a. Constantb. NamedConstantc. Finald. Concrete
What will the following code output? int apples = 0, bananas = 2, pears = 10;apples += 10;bananas *= 10;pears /= 10;System.out.println(apples + " " + bananas + " " + pears);
Why are variable names like x not recommended?
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales
Study the following program and show what it will print on the screen. // The Works of Wolfgangpublic class Wolfgang{ public static void main(String[]
These characters mark the beginning of a multi-line comment.a. //b. /*c. */d. /**
What will the following code output? Double d = 12.9;Int i = (int)d;System.out.println(i);
Showing 1100 - 1200
of 1252
1
2
3
4
5
6
7
8
9
10
11
12
13