Return to Video

Plan to Update Score

  • 0:00 - 0:02
    Okay, we made a variable but
  • 0:02 - 0:05
    nothing about the functionality
    of the app has changed yet.
  • 0:05 - 0:08
    The next thing that I want
    you to do is to make it so
  • 0:08 - 0:12
    that when you click the +3 POINTS
    button, the score goes up by 3.
  • 0:12 - 0:16
    Meaning that if I click this
    multiple times, it should be adding.
  • 0:16 - 0:18
    These other buttons
    don't have to work yet.
  • 0:18 - 0:19
    It's fine.
  • 0:19 - 0:21
    Now again, I want to stress planning.
  • 0:21 - 0:24
    So, before you actually go ahead and
    write this in Java,
  • 0:24 - 0:26
    you're going to write it in English.
  • 0:26 - 0:29
    Or at least you're going to write it in
    a special kind of English that Katherine
  • 0:29 - 0:32
    talked about in the lesson
    called Pseudocode.
  • 0:32 - 0:35
    So, let's say your goal is that when
  • 0:35 - 0:38
    the +3 POINTS button is clicked
    you want two things to happen.
  • 0:38 - 0:42
    And I'm making this kind of
    a multiple choice problem.
  • 0:42 - 0:46
    So the things that you can
    have happen during Step 1 are,
  • 0:46 - 0:47
    you could display scoreTeamA.
  • 0:47 - 0:50
    You could change the value
    of scoreTeamA to 3,
  • 0:50 - 0:54
    or another way of saying that
    is set the scoreTeamA to 3.
  • 0:54 - 0:57
    You could display the scoreTeamA plus 3.
  • 0:57 - 1:01
    Or you could increase
    the scoreTeamA by 3.
  • 1:01 - 1:04
    And then for Step 2,
    you have these same options.
  • 1:04 - 1:08
    So just randomly,
    if you want your two instructions to be,
  • 1:08 - 1:13
    Display the scoreTeamA, Set the
    scoreTeamA to 3, you would select A to
  • 1:13 - 1:18
    first Display the scoreTeamA, and
    then B, set the scoreTeamA to 3.
  • 1:18 - 1:20
    Okay, you tell me,
    what do you think the two steps are?
Title:
Plan to Update Score
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
UD837 - Android for Beginners
Duration:
01:22

English subtitles

Revisions Compare revisions