Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which expression below properly illustrates the syntax required to check if the variable saleAmount contains a value greater than 1000 but less than 5000? Group

 Which expression below properly illustrates the syntax required to check if the variable saleAmount contains a value greater than 1000 but less than 5000?

Group of answer choices

  • saleAmount > 1000 ||< 5000
  • saleAmount > 1000 ||saleAmount< 5000
  • saleAmount > 1000 && < 5000
  • saleAmount > 1000 && saleAmount < 5000

2. The value of W after the following statements are executed is _____. int X = 10, Y = 8; int W = ((X > 7) &&(Y > 2)) ? (X) : (Y) ; System.out.println("W = " + W);


  • W = 2
  • W = 7
  • W = 8
  • W = 10

3. A block of statements after the while loop's boolean expression is called the loop ____________________.


4. If a = 15, then the value of ++a is ____________________.


5. If b is 7 and c is 10, the value of c after the following statement is executed is _____. c *= b--;


  • 6
  • 7
  • 60
  • 70

6. If you are reading responses from the user, which loop would you most likely use?

  • for
  • for...next
  • while
  • while...next

7. The following is an example about a process called _____. totalBalance = totalBalance + balance;

  • adding
  • counting
  • accumulating
  • balancing

8. The output of the following program is _____. public class Test { public static void main(String [] args) { int a = 10; do { System.out.print(a + " "); } while (a-- > 5); } }


  • 10 9 8 7 6 5
  • 9 8 7 6 5 4
  • 10 9 8 7 6
  • 10 9 8 7 6 5 4

9. The output of the following program is _____. public class Test { public static void main(String [] args) { int a = 4; int b = 7; int c = ++a + b++; System.out.println("c = " + c); } }


10. The value of b after the following statements are executed is _____. int b = 17; int c = 5; b /= c;


  • 3.4
  • 3
  • 5
  • 0








Step by Step Solution

3.37 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Q1 saleAmount 1000 saleAmount 5000 Here there is two conditions saleAmount 1000 and saleAmount 5000 ... 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

John E Freunds Mathematical Statistics With Applications

Authors: Irwin Miller, Marylees Miller

8th Edition

978-0321807090, 032180709X, 978-0134995373

More Books

Students also viewed these Programming questions