Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class nurseryRhymes
- {
- private String frogs;
- private String frogs2;
- private String monkeys;
- private String hdd;
- private String hdd2;
- /*
- * default constructor
- */
- public nurseryRhymes()
- {
- frogs = "little speckled frogs, nsitting on a speckled log, neating the most delicious bugs, nyum, yum, none jumped into the pool, nwhere it is nice and cool, nnow there are";
- frogs2 = "little speckled frogs! nribbit, ribbit n";
- monkeys = "little monkeys jumping on the bed, nOne fell off and bumped his head, nMama called the doctor, nAnd the doctor said,nNo more monkeys jumping on the bed";
- hdd = "Hickory Dickory dock, The mouse ran up the clock, nThe clock struck,";
- hdd2 = "nThe mouse ran down, nHickory Dickory dock.";
- }
- public String getFrogs()
- {
- return frogs;
- }
- public String getFrogs2()
- {
- return frogs2;
- }
- public String getMonkeys()
- {
- return monkeys;
- }
- public String getHdd()
- {
- return hdd;
- }
- public String getHdd2()
- {
- return hdd2;
- }
- public String toString()
- {
- return frogs + frogs2 + monkeys + hdd + hdd2;
- }
- }
- import java.io.*;
- import java.util.*;
- public class FullNurseryRhymes
- {
- public static void main(String[] args)
- {
- nurseryRhymes rhymes = new nurseryRhymes();
- for(int i = 3; i >= 1; i--)
- System.out.print(i + nurseryRhymes.getFrogs() + i + nurseryRhymes.getFrogs2());
- //Your code here to print out lyrics for 10 little monkeys from 10 to 1
- //Or any of your own choices in decrementing pattern
- //Your code here to print Hickory Dickory Dock strike 1 to 12
- //Or any of your own choices in incrementing pattern
- //Your code here to check if baby is sleeping while ABCs (your own
- //choices) is played continuously (see next assignment ABCs)
- }
- }
- nurseryRhymes.getFrogs()
- rhymes.getFrogs()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement