Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class JackJill3Method { public static void main(String[] args) { jackJillSong(Jack, Jill); jackJillSong(Allen, Jill); jackJillSong(Bob, Bella); jackJillSong(Charlie, Cindy); jackJillSong(David, Dina); jackJillSong(Eddie, Eva); } // TODOs:
public class JackJill3Method { public static void main(String[] args) { jackJillSong("Jack", "Jill"); jackJillSong("Allen", "Jill"); jackJillSong("Bob", "Bella"); jackJillSong("Charlie", "Cindy"); jackJillSong("David", "Dina"); jackJillSong("Eddie", "Eva"); } // TODOs: // Define the method jackJillSong below so that this program prints the same songs as JackJill2s.java }
Please convert the following solution to one based on methods. public class JackJill3 \{ public static void main(String[] args) \{ System.out.println("Jack and Jill went up a hill"); System.out.printin("'To fetch a pail of water,"); System.out.printin("Jack falls down and broke his crown,"); System.out.printin("and Jill came tumbling after."); System.out.println(); System.out.printin("Allen and Anna went up a hill"); System.out.println("'To fetch a pail of water,"); System.out.printin("Allen falls down and broke his crown,"); System.out.printIn("and Anna came tumbling after."); System.out.printin(); System.out.printIn("Bob and Bella went up a hill"); System.out.printin("'To fetch a pail of water,"); System.out.printin("Bob falls down and broke his crown,"); System.out.println("and Bella came tumbling after."); System.out.println(); System.out.printIn("'Charlie and Cindy went up a hill"); System.out.printIn("'To fetch a pail of water,"); System.out.println("Charlie falls down and broke his crown,"); System.out.printin("and Cindy came tumbling after."); System.out.println(); System.out.printin("David and Dina went up a hill"); System.out.printin("'To fetch a pail of water,"); System.out.printin("David falls down and broke his crown,"); System.out.println("and Dina came tumbling after."); System.out.printin(); System.out.printin("Eddie and Eva went up a hill"); System.out.println("'To fetch a pail of water,"); System.out.printin("Eddie falls down and broke his crown,"); System.out.println("and Eva came tumbling after."); System.out.println(); \}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started