1 Introduction To Computers And Java 2 Java Fundamentals 3 Decision Structures 4 Loops And Files 5 Methods 6 A First Look At Classes 7 Arrays And The Arraylist Class 8 A Second Look At Classes And Objects 9 Text Processing And More About Wrapper Classes 10 Inheritance 11 Exceptions And Advanced File I/o 12 Javafx: Gui Programming And Basic Controls 13 Javafx: Advanced Controls 14 Javafx: Graphics, Effects, And Media 15 Recursion 16 Sorting, Searching, And Algorithm Analysis 17 Generics 18 Collections And The Stream Api 19 Linked Lists 20 Stacks And Queues 21 Binary Trees, Avl Trees, And Priority Queues expand_more
2.1 The Parts Of A Java Program 2.2 The Print And Println Methods, And The Java Api 2.3 Variables And Literals 2.4 Primitive Data Types 2.5 Arithmetic Operators 2.6 Combined Assignment Operators 2.7 Conversion Between Primitive Data Types 2.8 Creating Named Constants With Final 2.9 The String Class 2.10 Scope 2.11 Comments 2.12 Programming Style 2.13 Reading Keyboard Input 2.14 Dialog Boxes 2.15 Common Errors To Avoid Chapter Questions expand_more
Problem 1MC: Every complete statement ends with a __________. a. period b. parenthesis c. semicolon d. ending... Problem 2MC: The following data 72 'A' Hello World 2.8712 are all examples of __________. a. variables b.... Problem 3MC: A group of statements, such as the contents of a class or a method, are enclosed in a. braces {} b.... Problem 4MC: Which of the following are not valid assignment statements? (Indicate all that apply.) a. total = 9;... Problem 5MC: Which of the following are nor valid println statements? (Indicate all that apply.) a.... Problem 6MC: The negation operator is __________. a. unary b. binary c. ternary d. none of these Problem 7MC: This key word is used to declare a named constant. a. constant b. namedConstant c. final d. concrete Problem 8MC: These characters mark the beginning of a multi-line comment. a. // b. / c. / d. / Problem 9MC: These characters mark the beginning of a single-line comment. a. // b. / c. / d. / Problem 10MC: These characters mark the beginning of a documentation comment. a. // b. / c. / d. / Problem 11MC: Which Scanner class method would you use to read a string as input? a. nextString b. nextLine c.... Problem 12MC: Which Scanner class method would you use to read a double as input? a. nextDouble b. getDouble c.... Problem 13MC: You can use this class to display dialog boxes. a. JOptionPane b. BufferedReader c.... Problem 14MC Problem 15MC Problem 16TF: True or False: A left brace in a Java program is always followed by a right brace later in the... Problem 17TF: True or False: A variable must be declared before it can be used. Problem 18TF: True or False: Variable names may begin with a number. Problem 19TF: True or False: You cannot change the value of a variable whose declaration uses the final key word. Problem 20TF: True or False: Comments that begin with / / can be processed by javadoc. Problem 21TF: True or False: If one of an operators operands is a double, and the other operand is an int, Java... Problem 1PTO: What will the following code segments print on the screen? 1. int freeze = 32, boil = 212; freeze =... Problem 2PTO: int x = 0, y=2; x = y 4; System.out.println(x + \n + y + In); Problem 3PTO: System.out.print(I am the incredible); System.out.print(computing\nmachine); System.out.print(\nand... Problem 4PTO: System.out.print(Be careful\n); System.out.print(This might/n be a trick );... Problem 5PTO: int a, x = 23; a = x % 2; System.out.println(x + \n + a); Problem 1FTE: Find the Error There are a number of syntax errors in the following program. Locate as many as you... Problem 1AW: Show how the double variables temp, weight, and age can be declared in one statement. Problem 2AW Problem 3AW: Write assignment statements that perform the following operations with the variables a, b, and c. a.... Problem 4AW: Assume the variables result, w, x, y, and z are all integers, and that w = 5, x = 4, y = 8, and z =... Problem 5AW Problem 6AW: Modify the following program so it prints two blank lines between each line of text. public class {... Problem 7AW: What will the following code output? int apples = 0, bananas = 2, pears =10; apples += 10; bananas... Problem 8AW: What will the following code output? double d = 12.9; int i = (int)d; System.out.println(i); Problem 9AW: What will the following code output? String message = Have a great day!;... Problem 10AW: What will the following code output? String message = Have a great day!;... Problem 11AW: Convert the following pseudocode to Java code. Be sure to declare the appropriate variables. Store... Problem 12AW Problem 13AW: Write the code to set up all the necessary objects for reading keyboard input. Then write code that... Problem 14AW Problem 15AW: A program has a float variable named total and a double variable named number. Write a statement... Problem 1SA: Is the following comment a single-line style comment or a multi-line style comment? / This program... Problem 2SA: Is the following comment a single-line style comment or a multi-line style comment? // This program... Problem 3SA: Describe what the phrase self-documenting program means. Problem 4SA Problem 5SA Problem 6SA Problem 7SA Problem 8SA Problem 9SA: Briefly describe the difference between variable assignment and variable initialization. Problem 10SA: What is the difference between comments that start with the // characters and comments that start... Problem 11SA: Briefly describe what programming style means. Why should your programming style be consistent? Problem 12SA: Assume that a program uses the named constant PI to represent the value 3.14. The program uses the... Problem 13SA: Assume the file Sales Average, java is a Java source file that contains documentation comments.... Problem 14SA Problem 1PC: Name, Age, and Annual Income Write a program that declares the following: a String variable named... Problem 2PC: Name and Initials Write a program that has the following String variables: firstName, middleName,... Problem 3PC: Personal Information Write a program that displays the following information, each on a separate... Problem 4PC: Star Pattern Write a program that displays the following pattern: Problem 5PC: Sales Prediction The East Coast sales division of a company generates 62 percent of total sales.... Problem 6PC: Land Calculation One acre of land is equivalent to 43,560 square feet. Write a program that... Problem 7PC: Sales Tax Write a program that will ask the user to enter the amount of a purchase. The program... Problem 8PC: Cookie Calories A bag of cookies holds 40 cookies. The calorie information on the bag claims that... Problem 9PC: Miles-per-Gallon A cars miles-per-gallon (MPG) can be calculated with the following formula:... Problem 10PC: Test Average Write a program that asks the user to enter three test scores. The program should... Problem 11PC: Circuit Board Profit An electronics company sells circuit boards at a 40 percent profit. If you know... Problem 12PC Problem 13PC: Restaurant Bill Write a program that computes the tax and tip on a restaurant bill. The program... Problem 14PC: Male and Female Percentages Write a program that asks the user for the number of males and the... Problem 15PC: Stock Commission Kathryn bought 600 shares of stock at a price of 21.77 per share. She must pay her... Problem 16PC: Energy Drink Consumption A soft drink company recently surveyed 12,467 of its customers and found... Problem 17PC: Ingredient Adjuster A cookie recipe calls for the following ingredients: 1.5 cups of sugar cup of... Problem 18PC: Word Game Write a program that plays a word game with the user. The program should ask the user to... Problem 19PC: Stock Transaction Program Last month Joe purchased some stock in Acme Software, Inc. Here are the... Problem 20PC: Planting Grapevines A vineyard owner is planting several new rows of grapevines and needs to know... Problem 21PC: Compound Interest When a bank account pays compound interest, it pays interest not only on the... format_list_bulleted