if(points == 0){ textView.setText("Loser"); imageView.setImageResource(R.id.sad); } else { textView.setText("Winner!"); imageView.setImageResource(R.id.happy); }
switch statement
switch (numberOfStarts){ case 1: rating = "Bad restaurant"; break; case 2: rating = "Okay restaurant"; break; case 3: rating = "Great restaurant"; break; default: rating = "No rating available"; break; }
switch statement
switch (grade){ case 'A': message = "Superb work"; break; case 'B': message = "Great job"; break; case 'C': message = "You did OK"; break; case 'D': case 'F': message = "Needs improvement"; break; default: message = "No grade available"; break; }