CSE 131 Module 8: Abstract Data Types

Extensions

Extension 1: Sad Cycles (5 points):

Authors
This extension needs a unit test. For now, run it as indicated at the end of this assignment.

Overview

So it turns out that numbers can feel things. We define a happy or sad number through this process:

  1. Split up the number into its digits.
  2. Square the digits and sum them.
  3. Repeat with the new sum until you reach a set of numbers that repeat or the number 1.
  4. If your process results in a repeating 1, your initial number was happy! Otherwise, it has fallen into a cycle of depression, characterized by the repeating numbers [4, 16, 37, 58, 89, 145, 42, 20, 4...] How sad.
For example, starting with the number 15, our process yields:

In this extension you will be designing a program that uses sets to find the sad cycle of a number for an arbitrary power.

Procedure

In the sadcycle package of your extensions folder, create a SadCycler class.

When you done with this extension, you must be cleared by the TA to receive credit.

This demo box is for extension 8.1
Last name WUSTL Key Propagate?
(NOT your numeric ID) Do not propagate
lower case only
e.g. Smith j.smith
1    

Acknowledgements and assertion of integrity

You must select one of the options below
The work submitted here was performed in accordance with this course's policy on collaboration.
On your honor, you have neither given nor received any unauthorized aid on this assignment.

However, the following TAs, students, or professors were supportive in completing this assignment.
Their help was also in accordance with course policies.

Thanks to (leave blank if appropriate):

In spite of seeking help as allowable by this course's policy on collaboration, you were unable to complete this assignment. No credit will be received for this assignment.

You would like to be contacted by an instructor to facilitate staying on track in this course.

Comments about this:

You have NOT abided by this course's policy on collaboration. No credit will be received for this assignment, but by checking this box, no academic integrity violation will be filed for this assignment.

You would like to be contacted by an intructor to faciliate staying on track in this course.

Comments about this:


TA: Password:

End of extension 1