Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Software Solutions
Quiz 2: Data and Expressions
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 41
Essay
Using the various String methods, manipulate a String called current to be the last character of current followed by the remainder of its characters in order, placing the result in a String called rearranged.
Question 42
Multiple Choice
Given three int variables with the values a = 5, b = 7, and c = 12, what is the value of z after the following statement is executed? int z = (a * b - c) / a;
Question 43
Multiple Choice
As presented in the Software Failure section of the text, the root cause of the Mars Climate Orbiter problem was
Question 44
Essay
Explain what the following statement computes: int z = (int)Math.ceil(Math.sqrt(x)/Math.sqrt(y));
Question 45
Multiple Choice
Example Code Ch 02-2 import java.util.Scanner; public class Questions33_34 { public static void main(String[] args) { int x, y, z; double average; Scanner scan = new Scanner(System.in) ; System.out.println("Enter an integer value") ; x = scan.nextInt() ; System.out.println("Enter another integer value") ; y = scan.nextInt() ; System.out.println("Enter a third integer value") ; z = scan.nextInt() ; average = (x + y + z) / 3; System.out.println("The result of my calculation is " + average) ; } } -Refer to Example Code Ch 02-2. What is the output if x = 0, y = 1, and z = 1?
Question 46
Essay
Given two points in an applet represented by the four int variables x1, y1, x2 and y2, write a paint method to draw a line between the two points and write the location of the two points next to the two points.
Question 47
Essay
Write an assignment statement to compute the gas mileage of a car where the int values milesTraveled and gallonsNeeded have already been input. The variable gasMileage needs to be declared and should be a double.
Question 48
Essay
How many ways are there to test to see if two String variables, a and b, are equal to each other if we ignore their case (for instance, "aBCd" would be considered equal to "ABcd")?
Question 49
Essay
Given four int values, x1, x2, y1, y2, write the code to compute the distance between the two points (x1, y1) and (x2, y2), storing the result in the double distance.
Question 50
Essay
Write a set of instructions to prompt the user for an int value and input it using the Scanner class into the variable x and prompt the user for a float value and input it using the Scanner class into the variable y.
Question 51
Essay
How do the statements "import java.util.*;" and "import java.util.Random;" differ from each other?
Question 52
Multiple Choice
Java is a strongly typed language. What is meant by "strongly typed"?
Question 53
Multiple Choice
Since you cannot take the square root of a negative number, which of the following could you use to find the square root of the variable x?
Question 54
Multiple Choice
Given x is a double and has the value 0.362491. To output this value as 36%, you could use the NumberFormat class with: NumberFormat nf = NumberFormat.getPercentInstance() ; Which of the following statements then would output x as 36%?