Problem 1RE: What is the value of each variable after the if statement? a. int n = 1; int k = 2; int r = n; if (k... Problem 2RE Problem 3RE: Find the errors in the following if statements. a. if x 0 then System.out.print(x); b. if (1 + x ... Problem 4RE: What do these code fragments print? a. int n = 1; int m = -1; if (n -m) { System.out.print(n); }... Problem 5RE: Suppose x and y are variables of type double. Write a code fragment that sets y to x if x is... Problem 6RE: Suppose x and y are variables of type double. Write a code fragment that sets y to the absolute... Problem 7RE: Explain why it is more difficult to compare floating-point numbers than integers. Write Java code to... Problem 8RE: Given two pixels on a computer screen with integer coordinates (x1, y1) and (x2, y2), write... Problem 9RE: It is easy to confuse the - and operators. Write a test program containing the statement if (floor... Problem 10RE: Each square on a chess board can be described by a letter and number, such as g5 in this example:... Problem 11RE Problem 12RE: In a scheduling program, we want to check whether two appointments overlap. For simplicity,... Problem 13RE: Draw a flowchart for the algorithm in Exercise R3.12. Problem 14RE: Draw a flowchart for the algorithm in Exercise E3.13. Problem 15RE: Draw a flowchart for the algorithm in Exercise E3.14. Problem 16RE Problem 17RE Problem 18RE: Write pseudocode for a program that prompts the user for a month and day and prints out whether it... Problem 19RE: Write pseudocode for a program that assigns letter grades for a quiz, according to the following... Problem 20RE: Explain how the lexicographic ordering of strings in Java differs from the ordering of words in a... Problem 21RE: Of the following pairs of strings, which comes first in lexicographic order? a. "Tom", "Jerry" b.... Problem 22RE: Explain the difference between an if/else if/else sequence and nested if statements. Give an example... Problem 23RE: Give an example of an if/else if/else sequence where the order of the tests does not matter. Give an... Problem 24RE: Rewrite the condition in Section 3.3 to use operators instead of = operators. What is the impact on... Problem 25RE Problem 26RE: Make up a Java code example that shows the dangling else problem using the following statement: A... Problem 27RE: Complete the following truth table by finding the truth values of the Boolean expressions for all... Problem 28RE: True or false? A B is the same as B A for any Boolean conditions A and B. Problem 29RE: The advanced search feature of many search engines allows you to use Boolean operators for complex... Problem 30RE: Suppose the value of b is false and the value of x is 0. What is the value of each of the following... Problem 31RE: Simplify the following expressions. Here, b is a variable of type boolean. a. b == true b. b ==... Problem 32RE: Simplify the following statements. Here, b is a variable of type boolean and n is a variable of type... Problem 33RE: What is wrong with the following program? System.out.print("Enter the number of quarters: "); int... Problem 1PE: Write a program that reads an integer and prints whether it is negative, zero, or positive. Problem 2PE: Write a program that reads a floating-point number and prints zero if the number is zero. Otherwise,... Problem 3PE: Write a program that reads an integer and prints how many digits the number has, by checking whether... Problem 4PE: Write a program that reads three numbers and prints all the same if they are all the same, all... Problem 5PE: Write a program that reads three numbers and prints increasing if they are in increasing order,... Problem 6PE: Repeat Exercise E3.5, but before reading the numbers, ask the user whether increasing/decreasing... Problem 7PE: Write a program that reads in three integers and prints in order if they are sorted in ascending or... Problem 8PE: Write a program that reads four integers and prints two pairs if the input consists of two matching... Problem 9PE: A compass needle points a given number of degrees away from North, measured clockwise. Write a... Problem 10PE: Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit.... Problem 11PE: The boiling point of water drops by about one degree centigrade for every 300 meters (or 1,000 feet)... Problem 12PE: Add error handling to Exercise E3.11. If the user does not enter a number when expected, or provides... Problem 13PE: When two points in time are compared, each given as hours (in military time, ranging from 0 and 23)... Problem 14PE: The following algorithm yields the season (Spring, Summer, Fall, or Winter) for a given month and... Problem 15PE: Write a program that reads in two floating-point numbers and tests whether they the same up to two... Problem 16PE: Unit conversion. Write a unit conversion program that asks the users from which unit they want to... Problem 17PE: Write a program that prompts the user to provide a single character from the alphabet. Print Vowel... Problem 18PE: Write a program that asks the user to enter a month (1 for January, 2 for February, and so on) and... Problem 1PP: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,... Problem 2PP: Write a program that translates a number between 0 and 4 into the closest letter grade. For example,... Problem 3PP: Write a program that takes user input describing a playing card in the following shorthand notation:... Problem 4PP: Write a program that reads in three floating-point numbers and prints the largest of the three... Problem 5PP: Write a program that reads in three strings and sorts them lexicographically. Enter three strings:... Problem 6PP: Write a program that prompts for the day and month of the users birthday and then prints a... Problem 7PP: The original U.S. income tax of 1913 was quite simple. The tax was percent on the first 50,000.... Problem 8PP: Write a program that computes taxes for the following schedule. Problem 9PP: The TaxReturn.java program uses a simplified version of the 2008 U.S. income tax schedule. Look up... Problem 10PP: Write a program that reads in the x- and y-coordinates of two corner points of a rectangle and then... Problem 11PP: Write a program that reads in the x- and y-coordinates of three corner points of a triangle and... Problem 12PP: Write a program that reads in the x- and y-coordinates of four corner points of a quadrilateral and... Problem 13PP: Roman numbers. Write a program that converts a positive integer into the Roman number system. The... Problem 14PP: A year with 366 days is called a leap year. Leap years are necessary to keep the calendar... Problem 15PP: French country names are feminine when they end with the letter e, masculine otherwise, except for... Problem 16PP: Write a program to simulate a bank transaction. There are two bank accounts: checking and savings.... Problem 17PP: Write a program that reads in the name and salary of an employee. Here the salary will denote an... Problem 18PP: When you use an automated teller machine (ATM) with your bank card, you need to use a personal... Problem 19PP: Calculating the tip when you go to a restaurant is not difficult, but your restaurant wants to... Problem 20PP: A supermarket awards coupons depending on how much a customer spends on groceries. For example, if... Problem 21PP: Write a program that prompts the user for a wavelength value and prints a description of the... Problem 22PP: Repeat Exercise P3.21, modifying the program so that it prompts for the frequency instead. Problem 23PP: Repeat Exercise P3.21, modifying the program so that it first asks the user whether the input will... Problem 24PP: A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside... Problem 25PP: Sound level L in units of decibel (dB) is determined by L=20log10(p/p0) where p is the sound... Problem 26PP: The electric circuit shown below is designed to measure the temperature of the gas in a chamber. The... Problem 27PP: Crop damage due to frost is one of the many risks confronting farmers. The figure below shows a... Problem 28PP: A mass m = 2 kilograms is attached to the end of a rope of length r = 3 meters. The mass is whirled... Problem 29PP: The average person can jump off the ground with a velocity of 7 mph without fear of leaving the... format_list_bulleted