WSQ09 – The Movies

Background

In this assignment we should be into more classes to implement the program. You will want to check out the Java Collections Framework since this looks like the Dictionary you probably used in Python. In this case the key will be a string (the movie title) and the value with be a list (or set perhaps) of strings (actor names).

What to Do

<small><a title="(#20 of 365) Movie Night" href="http://flickr.com/photos/jennfinley/793827083">flickr photo</a> shared by <a href="http://flickr.com/people/jennfinley">j-fin</a> under a <a href="http://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons ( BY-NC-ND ) license</a> </small>
flickr photo shared by j-fin under a Creative Commons ( BY-NC-ND ) license

The details of the assignment can be found at the following URL, I should pull some of that description over here (note that the material on the authors’ page is indeed Creative Commons license CC-BY 3.0 as is mine) . *NOTE* that these assignments are based on Python2 syntax in case you want to run this in Python. Of course your solution will be with Java using object-oriented programming.

http://www.cse.msu.edu/~cse231/PracticeOfComputingUsingPython/06_Dictionaries/Movies/

The authors’ page is also a good source for more Python programming assignments http://www.cse.msu.edu/~cse231/PracticeOfComputingUsingPython/

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ09 on your post so our blog hub picks that up.

You should include your code as a link to GitHub.

And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC201 so we all see your question posted there.

WSQ08 – Yo Soy 196

Background

creative commons licensed (BY-NC-ND) flickr photo by K & P: http://flickr.com/photos/kenandpauline/5490820
creative commons licensed (BY-NC-ND) flickr photo by K & P: http://flickr.com/photos/kenandpauline/5490820

Lychrel numbers are natural numbers that do not form a palindrome after successive additions to their inverse. See details on Wikipedia: http://en.wikipedia.org/wiki/Lychrel_number

What to Do

Your jobs is to create a program that asks the user for two pieces of data:

  • The lower bound of the sequence
  • The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196”
Again, think OBJECT-oriented programming in Java!

Details

The report must show:
  • The range of numbers analysed (lower to upper bound)
  • The number of natural palindromes (no addition to inverse needed)
  • The number of non-Lycherels encountered (become palindromes)
  • The number of Lycherel number candidates (that did not converge to palindrome)

Since you will not be able to prove that a number is Lycherel (since you cannot computer forever to check), our definition for a Lycherel candidate will be if a number does not converge after 30 iterations of applying the addition to the inverse.

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ08 on your post so our blog hub picks that up.

You should include your code as a link to GitHub. You really should start using your GitHub repository now. If you need help on that, just ask Ken or your classmates.

And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC201 so we all see your question posted there.

WSQ07 – Babylonian Method

Background

creative commons licensed (BY-NC-SA) flickr photo by Sebastià Giralt: http://flickr.com/photos/sebastiagiralt/3085199693
creative commons licensed (BY-NC-SA) flickr photo by Sebastià Giralt: http://flickr.com/photos/sebastiagiralt/3085199693

In this assignment you will write a program to calculate the square root of a number using the Babylonian method. You can search for that method, it will be easy to find.

What to Do

Again, this is Java and object-oriented programming. Don’t lean on your imperative roots but think objects and messages here.

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ07 on your post so our blog hub picks that up.

You should include your code as a link to GitHub.

And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC201 so we all see your question posted there.

WSQ06 – Greatest Common Divisor

Java Programming

Okay, a simple one to start and many of you already did this in Python. The trick here should be to implement this with message calls, not a simple iterative solution. You should be asking the number, “hey, what is the greatest common divisor you have in common with this one I am passing you as a parameter?”

Background

creative commons licensed (BY-NC-SA) flickr photo by the past tends to disappear: http://flickr.com/photos/daniandgeorge/11906109865
creative commons licensed (BY-NC-SA) flickr photo by the past tends to disappear: http://flickr.com/photos/daniandgeorge/11906109865

In this assignment you will write a program to calculate the greatest common denominator of two positive integers using Euclid’s algorithm.

What to Do

Okay, a simple one to start and many of you already did this in Python, now to do this in Java with objects. The trick here should be to implement this with message calls, not a simple iterative solution. You should be asking the number, “hey, what is the greatest common divisor you have in common with this one I am passing you as a parameter?”

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ06 on your post so our blog hub picks that up.

You should include your code as a link to GitHub.

And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC201 so we all see your question posted there.