Quiz 06

flickr photo by waxesstatic https://flickr.com/photos/waxesstatic/2335673197 shared under a Creative Commons (BY) license

Weekly Quiz

Write your code for the quiz, then:

  • email your answers (as file attachments) to Ken.
  • Most important: blog about your answers. You should explain the code, your process and link to code on GitHub.

The Quiz (same for both C++/Python)

  1. Write a function to calculate the greatest common denominator of two positive integers using Euclid’s algorithm.

What to Do

The function should receive two integers and return an integer.Obviously you should test your function, so create a main program that asks the user for two values, calculates the gcd and displays that.  This page may help https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-euclidean-algorithm

Get Creative, put style in your Blog Posts

Make the posts your expression, be good internet citizens but also have fun!

flickr photo by waxesstatic https://flickr.com/photos/waxesstatic/2335673197 shared under a Creative Commons (BY) license
flickr photo by waxesstatic https://flickr.com/photos/waxesstatic/2335673197 shared under a Creative Commons (BY) license

CC BY-SA 4.0 Quiz 06 by Ken Bauer is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

One thought on “Quiz 06

Leave a Reply

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