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.

CC BY-SA 4.0 WSQ06 – Greatest Common Divisor by Ken Bauer is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *