540 likes | 607 Views
int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four");. x = 3. int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one");
E N D
int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four");
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four");
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 true x > 2
x = 3 int x = 3; if (x > 1) if (x > 2){ if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one”
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); }else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); }elseSystem.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); }else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” “four” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” “four” }
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” “four” } The end.
x = 3 int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); true x > 1 { true x > 2 true x > 3 “one” “three” “four” } The end. The end. Nothing gets printed.
int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); Old problem
int x = 3; if (x > 1) { if (x > 2) if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); New problem
Old problem int x = 3; if (x > 1) if (x > 2) { if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four");
New problem int x = 3; if (x > 1) { if (x > 2) if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four");
New problem int x = 3; if (x > 1) { if (x > 2) if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); else w/out if Does not compile!
New problem int x = 3; if (x > 1) { if (x > 2) if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); else w/out if Does not compile! The only solution, then, is to carefully draw the flowchart!
New problem int x = 3; if (x > 1) { if (x > 2) if (x > 3) System.out.println("one"); } else System.out.println("three"); else System.out.println("four"); else w/out if Does not compile! The only solution, then, is to carefully draw the flowchart! There really isn’t any reliable, uniform shortcut alternative to that.
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less
initialize the amount the user needs to pay while (the amount due is more than zero) { prompt the user for input (a line) get the line and prepare to take it apart while (there are still tokens available) { get next token (call it token) interpret it, and update amount } // if you get here you’re done with the line // but the amount due can still be positive } // if you get here the amount due is zero or less