O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Selection Statements

nhunsdale02 Programming I Masters Inglês 19 flashcards

Flashcards do conjunto (19)

  1. 1What are the 3 Selection Statements?1) If
    2) If-Else
    3) Switch
  2. 2Operators Confusing the Equality Error(==) with the assignment operator (=) can cause _____error
  3. 3Logical Operators What do they enable?Testing of multiple conditions in the process of making a decision
  4. 4Logical Operators && What does this mean?AND
  5. 5Logical Operators || What does this mean?OR
  6. 6Logical Operators ?: What is this called? What does this mean?Ternary
    Shorthand for if-then-else
  7. 7If Statements If the statement is NOT true, what happens?It is skipped unless there is an else
  8. 8If Else Allows you to specify an action to perform when the condition is _____ and _____TRUE and FALSE
  9. 9If Else What is the conditional operator sign for If Else??:
  10. 10If Else Using a conditional operator, write a if else statement so that if a grade is over 50 then "Pass" is outputted, or else "Fail" if it is below 50syso(grade>= 50 ? "Pass" : "Fail");
  11. 11If Else Using a conditional operator, set the max int to be the greater value of two ints a==5 and b==6max = (a>b) ? a : b;
  12. 12Nested If-Else Statements It can be used to test _____ cases under the main if statement, what is the next condition?multiple
    else if
  13. 13Dangling Else Problem What is it?Not including curly brackets (braces{}) then the else will refer to the most immediate instance of If(one if inside another) rather than referring to the intended original If
    JUST PUT YOUR CURLY BRACES IN AND YOU'LL BE FINE!
  14. 14Braces While it is possible to exclude them if you only have one statement, it is recommended not to! Why not?1) Increases Code Readability
    2) Reduces Logical Errors
    3) Ease of Maintenance
  15. 15Switch Statement Why leave the default until the end?There is no "break;" required then
  16. 16Switch Statement What is "fall-through"?If a "break;" is not employed after each condition then all statements after the matching case label will be executed
  17. 17Switch Statement Can you have multiple cases?Yes
  18. 18Switch Statement Can you have multiple conditions?Yes
  19. 19Switch Statements As of Java SE 7, you can use _____ in a Switch StatementsStrings

Informações

Descrição
Masters Programming I FlashCards sobre Selection Statements, criado por nhunsdale02 em 04-06-2014.
Criado por
nhunsdale02
Visualizações
18
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?