MysterySong.java
1    /* 
2     * Mystery song time! Play the sequence of 14 notes from the figure 
3     * Featured Constraint: No SComposer objects, write program using only the SNote object 
4     */
5    
6    package mmw;
7    
8    import note.SNote;
9    
10   public class MysterySong {
11       public static void main(String[] args) {
12           SNote note = new SNote();
13           note.text();
14           note.play();
15           note.rp(); note.play();
16           note.rp(); note.play(); note.lp(); note.lp(); //invariant
17           note.play();
18           note.play();
19           note.rp(); note.play();
20           note.rp(); note.play(); note.lp(); note.lp(); //invariant
21           note.play();
22           note.rp(2); note.play();
23           note.rp(); note.play();
24           note.x2(); note.rp(); note.play(); note.s2(); //invariant
25           note.lp(2); note.play();
26           note.rp(); note.play();
27           note.x2(); note.rp(); note.play();
28           System.out.println();
29       }
30   }
31