1 / 9

Project 3: Farey Sequences

Project 3: Farey Sequences. Farey Sequences. Programming Assignment 1. Drozdek, Page 133. Further details about Farey sequences, and more examples, can be found in the Wikipedia article: http://en.wikipedia.org/wiki/Farey_sequence. Specifications.

Download Presentation

Project 3: Farey Sequences

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project 3: Farey Sequences

  2. Farey Sequences Programming Assignment 1. Drozdek, Page 133 Further details about Farey sequences, and more examples, can be found in the Wikipedia article: http://en.wikipedia.org/wiki/Farey_sequence

  3. Specifications • Repeatedly prompt the user to enter a level and display the Farey sequence of that level. • Terminate when the user enters zero or a negative value. • Your output should match the sample run on the next slide for the same inputs.

  4. Sample Run

  5. Specifications • Define a class Fraction. • Define an insertion operator ( << ). • Use our List template with a parameter of Fraction. • Modify printAll to output all elements on the same line. • Except for printAll, do not modify the List template. • Define a function in main to create a Farey sequence of level N as a list of fractions.

  6. Implementation Hints • Create a level 1 Farey sequence as a list of two fractions, {0/1, 1/1}. • Use a loop (not recursion) to build up from level 1 to level N. • Use the traverseList method to build the next level. • Traverse level i list and build level i+1 list

  7. Ground Rules You may work with one other person. OK to work alone if you prefer. If you do work as a pair Both members are expected to contribute. Submit a single program. Both members should understand the program in detail. Do not share your work with other students. Before or after submitting the project. OK to discuss the project. Do not copy any other student’s work. Don’t look at anyone else’s program. 7

  8. Ground Rules Except for code posted on the class web site Do not copy code from the Internet or any other source. Write your own code. 8

  9. Submission Project is due by midnight, Tuesday night, Feb 8. Deliverables: Source code only. Fraction.h, Fraction.cpp, main.cpp We will provide DLList.h Zip your source code files using the Windows “Send to Compressed Folder” command. Submit the zipped file via Blackboard Assignments. If you work with another student, include both names in the assignment comments. Other student submit assignment with just a Blackboard comment including both names. End of Presentation 9

More Related