Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:

Similar presentations


Presentation on theme: "1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:"— Presentation transcript:

1 1 Project 3: Farey Sequences

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

3 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 4 Sample Run

5 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 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 77 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.

8 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.

9 99 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


Download ppt "1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:"

Similar presentations


Ads by Google