Question: (JAVA) Write a program which takes in either (1) an animal sound e.g. woof, or (2) an animal sound and a number e.g. meow 3.
(JAVA) Write a program which takes in either (1) an animal sound e.g. woof, or (2) an animal sound and a number e.g. meow 3. Write a method called makeNoise(String sound) which takes in a String and prints that string back at you. Then write the same method makeNoise(String sound, int num) which takes in a String and an int, and prints that string out that number of times in uppercase, with the same number of exclamation marks ! as the int. When the user enters only an animal sound, run the makeNoise(String sound) method. When the user enters an animal sound and an int, run the makeNoise(String sound, int num) method.
Example:
Make a sound: woof 3 WOOF BACK AT YOU!!! WOOF BACK AT YOU!!! WOOF BACK AT YOU!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
