Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

I'm working on making java code produce an output for lyrics on a song, but am confused on how to incorporate method calling to save on repeated verses. I can use the println statement for each line, but the teacher wants method calling as well. Hope someone can help out, thanks!

OpenStudy (anonymous):

So the code looks something like this: public class lyrics { public static void main(String[] args) { System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("");//new line System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("");//new line System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("blah blah blah"); System.out.println("");//new line System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse System.out.println("blah blah blah");//repeated verse } }

OpenStudy (anonymous):

How can I have the parts where the verses repeated do a "method call"?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!