Homework 2 Released

The second unit and homework have been released. The second homework assignment is due at Tuesday 23:59 UTC. Be sure to check the forums if you get stuck, and try not to get frustrated on starred problems.

asked 28 Feb '12, 21:41

PeterUdacity's gravatar image

PeterUdacity ♦♦
35.9k73219331
accept rate: 0%

Awesome! I'll get started on it. Thanks for the heads-up.

(29 Feb '12, 00:47) Krishna Sampath Krishna%20Sampath's gravatar image
1

Hello Peter! please be careful linking date to wolfram alpha with that format. 3/6/12 is an ambiguous date so WA is taking June, therefore it says 3 months 5 days 8 hours... in the future which is wrong

(29 Feb '12, 10:04) JuanMa JuanMa's gravatar image

I think it depends on how your region writes dates. I'll just stop using Wolfram Alpha in the future.

(01 Mar '12, 15:11) PeterUdacity ♦♦ PeterUdacity's gravatar image

5 Answers:

@graemeblake, what we should print out is actually the full multiplication table leading up to the number shown. In your example, you still need to print the "=" followed by the result. In short, it should look like this:

1*1 = 1

1*2 = 2

1*3 = 3

2*1 = 2

2*2 = 4

2*3 = 6

3*1 = 3

3*2 = 6

3*3 = 9

Also, a formatting tip: you can just include manual line break tags (< br >, with no spaces) after each line. to ensure that your choice of new lines are preserved.

link

answered 29 Feb '12, 09:54

Krishna%20Sampath's gravatar image

Krishna Sampath
7761732

edited 29 Feb '12, 10:03

Thanks, that's what I ended up doing for the assignment. Good to know about the spacing.

(29 Feb '12, 19:05) Graeme Graeme's gravatar image

Does it matter if it is
1*1 = 1 or
1 * 1 = 1 as given in the example in the code?

(29 Feb '12, 19:09) fnenu-1 ♦♦ fnenu-1's gravatar image

Would be interesting if missing spaces lead to a false grading. I think there should be some tolerance or the desired output should be absolutely clear.

(01 Mar '12, 06:26) Sebastian We... Sebastian%20Weichwald-1's gravatar image

I think spacing matters. 1 * 1 = 1 may be different that 1*1=1. Try to print them as shown in videos.

(01 Mar '12, 06:39) BogdanD BogdanD's gravatar image

It is shown with spaces before and after the asterisks and the equal sign, right?

(01 Mar '12, 06:44) Sebastian We... Sebastian%20Weichwald-1's gravatar image

Thanks @PeterUdacity!

link

answered 28 Feb '12, 21:43

Rob%20Barnes-3's gravatar image

Rob Barnes-3 ♦
19.1k1068205

thanks @peterUdacity

link

answered 29 Feb '12, 00:28

Shad%20Amez's gravatar image

Shad Amez
1

The final questions seems to be missing an extended example. In the video, David mentioned there would be a larger set of numbers so we could see exactly how the order goes.

As it is, the question isn't clear. For example, if the input if three, should the program print:

1 * 1 ||
1 * 2 ||
1 * 3 ||
2 * 1 ||
2 * 2 ||
2 * 3 ||
3 * 1 ||
3 * 2 ||
3 * 3

Or something different? Thanks!

(sorry for the horizontal bars. I wanted to display everything vertically, but the formatted reverted to a single line.)

link

answered 29 Feb '12, 01:29

Graeme's gravatar image

Graeme
5.9k214895

edited 29 Feb '12, 01:30

Use double space after the word to enter a new line.

(29 Feb '12, 10:52) Mukesh Agarw... Mukesh%20Agarwal-1's gravatar image

The problem with using two returns (I assume you don't mean the space bar), is that every single line will be double-spaced. If you are writing a few paragraphs, that's fine -- but here, where we have a long vertical list, I'd say it's better just to use line break tags, to avoid taking up twice as much space.

(29 Feb '12, 11:06) Krishna Sampath Krishna%20Sampath's gravatar image

It is the space bar. A double space at the end of a line followed by a return gives you a newline.

this is followed by two spaces and a return
but this is followed by two returns

and this is the line afterwards.

(29 Feb '12, 19:08) fnenu-1 ♦♦ fnenu-1's gravatar image

The link to WolframAlpha seems to be wrong, the date is off for about 1 month and something.

link

answered 01 Mar '12, 15:09

Carlos%20Sujou%20Sang%20Mata-1's gravatar image

Carlos Sujou...
433

Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15,266
×1,718
×42

Asked: 28 Feb '12, 21:41

Seen: 448 times

Last updated: 01 Mar '12, 15:11