Return to Video

Modeling a Text Message cs348 unit1new3

  • 0:00 - 0:04
    Before we get coding, let's have a quick look at the user interface for your
  • 0:04 - 0:07
    coding exercises. We're always starting with some guidance here, there's some
  • 0:07 - 0:11
    text you have to read through. Then, it's followed by the actual code file
  • 0:11 - 0:15
    which you have to edit. Once you press the Test Run button, you can execute
  • 0:15 - 0:19
    this code and you get a response down at the bottom. For example, here, we give
  • 0:19 - 0:23
    you an Exercise Hint and it says, The field sender is not of the right type,
  • 0:23 - 0:29
    expected unsigned integer. You can edit your code further. Press Test Run
  • 0:29 - 0:33
    again. You can reset the code to the beginning state. Or you can submit,
  • 0:33 - 0:38
    finally, your code for assessment and then we give you a Pass or Fail. And you
  • 0:38 - 0:43
    can try again, watch the answer, and so forth. We are just a few minutes into
  • 0:43 - 0:48
    the course, and we're already starting to code. This is exciting. I'll give you
  • 0:48 - 0:53
    first some pre-populated code. So, start with some scaffolding. Then, I tell
  • 0:53 - 0:58
    you what to do, the Guidance. You are taking that guidance and implements the
  • 0:58 - 1:03
    exercise. You can test out what you have coded by pressing the Run button, get
  • 1:03 - 1:10
    some output. Ad then eventually, you Submit it for assessment. After that, we
  • 1:10 - 1:14
    do a solution discussion. So, both, if you failed the exercise or if you passed
  • 1:14 - 1:20
    it, it's good to listen to this, you will get some additional context. What's
  • 1:20 - 1:24
    very important is to listen to the Guidance. If we tell you to name a variable
  • 1:24 - 1:28
    foo or bar, please listen to this, we need it so we can do automatic
  • 1:28 - 1:34
    assessment. Don't make up your own variable names if will give you some names.
  • 1:34 - 1:39
    So, let's get cranking. The first thing we need to do is define our sender and
  • 1:39 - 1:44
    receiver fields for our text message model. Their type would be unsigned
  • 1:44 - 1:49
    integer, so a positive integer numbers. And these are the values we are
  • 1:49 - 1:53
    assigning. Basically, we're sending a message from Manhattan to San Jose,
  • 1:53 - 1:59
    right? So, these are Hollywood style numbers, they're not listed. The text
  • 1:59 - 2:03
    message itself is called message, right, that's the content of the text
  • 2:03 - 2:10
    message, it's of type string and the text will be, "This is a Test!". Declaring
  • 2:10 - 2:15
    a field is very simple, you just use the FIELD_NAME followed by colon, TYPE,
  • 2:15 - 2:23
    and then end it with a semicolon. Similar syntax for assigning a field with a
  • 2:23 - 2:27
    value. Here's your class, you add in your fields here, send a receiver a
  • 2:27 - 2:32
    message and then here, you add your initial assignments. We're going to call
  • 2:32 - 2:37
    this methods fill to fill up this text message. Go ahead and knock yourself
  • 2:37 - 2:37
    out.
Title:
Modeling a Text Message cs348 unit1new3
Video Language:
English
Team:
Udacity
Project:
CS348 - Functional Hardware Verification
Duration:
02:38
Cogi-Admin added a translation

English subtitles

Revisions