Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

14. What is the correct expression that evaluates to true if the number x is between 1 and 100 (not inclusive) OR a multiple of

14. What is the correct expression that evaluates to true if the
number x is between 1 and 100 (not inclusive) OR a multiple of 3?
19. Given the following declaration, which of the following statements is most
accurate? Account acct = new Account();
a. acct contains an object of Account type
b. acct contains a reference to an Account object
c. acct can be assigned a double value
d. acct contains a double value
e. acct is a method
20. Within the body of a method named myMethod, there is a call to another method that
may throw a checked exception. What are the two options the programmer has to ensure
that myMethod will compile?
22. What is the OO concept that means the functionality of one class can be extended
over overridden in another class?
a. static
b. inheritance
c. classes
d. information hiding
e. polymorphism
26. For the following problem statement, would you include an if/else statement or a
switch statement? Explain your answer. Be sure to address both types of statements in
your answer. (You do not need to write the code.)
30. What is the value assigned to answer? Show your work one operator at a time.
int answer; answer = 6 * (3 + 5) % 7 + 5 / 2;
31. A salesperson earns a commission of 2% on sales up to $10,000, then earns a
commission of 5% on any sales over $10,000. Write a sequence of statements to save the
salesperson's commission to an integer value named commission, given his or her sales
in an integer value named sales. (You may round all commission values down.)
32. Write a single line of Java code to create an object called loc from the Location
class. Assume the class has a default constructor.
33. Assume x is 0. What is the output of the following statement?
if (x > 0)
System.out.print("negative");
else if (x < 0)
System.out.print("zero");
else
System.out.print("positive");
34. What is the value of j after the following code has executed
int i = 1;
int j = 1;
while (i < 3) {
i++;
j *= 5;
}
37. Which index value is used to retrieve the string "Mexico" from the array?
35. How many times is Hello displayed? (1 Point)
count = 0;
do {
System.out.println("Hello");
count++;
} while (count == 5);
Use the following array definition for questions 36 and 37:
String[] countries = {"United States", "Canada", "Mexico"};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago