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
Big Java Late Objects
Quiz 3: Decisionseasy
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 1
Multiple Choice
Which of the following operators is used as a relational operator?
Question 2
Multiple Choice
What is the output of the following code snippet? Double income = 45000; Double cutoff = 55000; Double minIncome = 30000; If (minIncome > income) { System.out.println("Minimum income requirement is not met.") ; } If (cutoff < income) { System.out.println("Maximum income limit is exceeded.") ; } Else { System.out.println("Income requirement is met.") ; }
Question 3
Multiple Choice
Which of the following statements is (are) true about an if statement? I. It guarantees that several statements are always executed in a specified order. II. It repeats a set of statements as long as the condition is true. III. It allows the program to carry out different actions depending on the value of a condition.
Question 4
Multiple Choice
Which of the following statements is correct about an if statement?
Question 5
Multiple Choice
Which of the following is the correct syntax for an if statement?
Question 6
Multiple Choice
What are the two parts of an if statement?
Question 7
Multiple Choice
The operator !> stands for
Question 8
Multiple Choice
Which of the following statements is true about the if statement?
Question 9
Multiple Choice
Assuming that a user enters 15 as input, what is the output of the following code snippet? Scanner in = new Scanner(System.in) ; System.out.print("Please enter a number: ") ; Int number = in.nextInt() ; If (number > 20) { System.out.println("The number is LARGE!") ; } Else { System.out.println("The number is SMALL!") ; }
Question 10
Multiple Choice
A store provides 10 percent discount on all items with a price of at least $100. No discount is otherwise applicable. Which of the following DOES NOT correctly compute the discount?
Question 11
Multiple Choice
Which statement about an if statement is true?
Question 12
Multiple Choice
Assuming that the user provides 303 as input, what is the output of the following code snippet? Int x; Int y; X = 0; Scanner in = new Scanner(System.in) ; System.out.print("Please enter a number: ") ; Y = in.nextInt() ; If (y > 300) { X = y; } Else { X = 0; } System.out.println("x: " + x) ;
Question 13
Multiple Choice
Suppose one needs an if statement to check whether an integer variable pitch is equal to 440 (which is the frequency of the note "A" to which strings and orchestras tune) . Which condition is correct?
Question 14
Multiple Choice
What kind of operator is the <= operator?
Question 15
Multiple Choice
Assuming that a user enters 25 as the value for x, what is the output of the following code snippet? Int x = 0; Scanner in = new Scanner(System.in) ; System.out.print("Enter a number: ") ; X = in.nextInt() ; If (x < 100) { X = x + 5; } If (x < 500) { X = x - 2; } If (x > 10) { X++; } Else { X--; } System.out.println(x) ;
Question 16
Multiple Choice
What is the output of the following code snippet if the input is 25? Int i = 0; Scanner in = new Scanner(System.in) ; System.out.print("Enter a number: ") ; I = in.nextInt() ; If (i > 25) { I++; } Else { I--; } System.out.print(i) ;