Menu

[Solved]Lab Make Program Returns Answer Six Riddles One Murder Mystery Try Solving Make Program Ar Q37018174

JAVA

This Lab will have you make a program which returns the answer to six riddles and one murder mystery. You can try solving alllimport 5ava.util. Scaneri 1 import java.util.scanner 3 /Write a method called answer() here param: an int which represents t

This Lab will have you make a program which returns the answer to six riddles and one murder mystery. You can try solving all of them and then make your program or if you aren’t up for it all of the answers are below the main method as class variables. The riddles are .What is harder to catch the faster you run? 2Mr. and Mrs. Mustard have six daughters and each daughter has one brother. How many people are in the Mustard family? 3.What has a head, a tail, is brown, and has no legs? 4.Before Mount Everest was discovered, what was the highest mountain on Earth? 5.They have not flesh, nor feathers, nor scales, nor bone. Yet they have fingers and thumbs of their own. What are they? 6.I am not alive, but I grow; I don’t have lungs, but I need air, I don’t have a mouth, but water kills me. What am 1? 7.You are a well known detective, and must solve the murder of the whistle-blower who was going to point you to the boss of an international syndicate that sells oil illegally. While inspecting you find a note under his shelf that has: 710 57735 34 5508 51 7718 Currently there are 3 suspects: Rooney Perry, Bill Jackson, Dane Bradford and Owen Waters. Break the code and find the murder! Did you solve all of them? Great, now for the program (a lot easier if you know the answers) First make a method called answer that returns a String and takes in an int Next make a switch statement which compares the int parameter with a case for each riddle and then returns the answer for the specified riddle o Example: case 1: return Ans1 There are two special cases oFor case 2 (riddle 2) you have to use String.format to return a string that contains (you can copy and paste): The sisters have one brother so 1+6+2-90?” (Replace the ? with the appropriate letter o The other special case will be the default case. This case will be the answer to the murder mystery, to return the answer you have to concatenate every item in the array arr to the class variable str using a for loop. Then return str limport 5ava.util. Scaneri 1 import java.util.scanner 3 /Write a method called answer() here param: an int which represents the riddle number 5 return: a String that has the answer 6 The Answers are below the main method as class variables 9 public class SolveIt 1 public static void main(Stringt] args) f Scanner scnr-new Scanner(System.in); SolveIt lab -new SolveIt(O; scanner scn new Scanner(System.in); int num = scn.nextInt(); System.out.printin(lab.answer(num)) //These are the answers not in the right order 6 String AnsM”Mount Everest” 9 String AnsP”A penny” String AnsC “Your breath!”; int AnsN = 9; String AnsF “Fire”; 0 String AnsG-“Gloves” String[] arr {“B”,”il”,”1 J”,”ack”,”son !”); string str “The Murder is ” Show transcribed image text This Lab will have you make a program which returns the answer to six riddles and one murder mystery. You can try solving all of them and then make your program or if you aren’t up for it all of the answers are below the main method as class variables. The riddles are .What is harder to catch the faster you run? 2Mr. and Mrs. Mustard have six daughters and each daughter has one brother. How many people are in the Mustard family? 3.What has a head, a tail, is brown, and has no legs? 4.Before Mount Everest was discovered, what was the highest mountain on Earth? 5.They have not flesh, nor feathers, nor scales, nor bone. Yet they have fingers and thumbs of their own. What are they? 6.I am not alive, but I grow; I don’t have lungs, but I need air, I don’t have a mouth, but water kills me. What am 1? 7.You are a well known detective, and must solve the murder of the whistle-blower who was going to point you to the boss of an international syndicate that sells oil illegally. While inspecting you find a note under his shelf that has: 710 57735 34 5508 51 7718 Currently there are 3 suspects: Rooney Perry, Bill Jackson, Dane Bradford and Owen Waters. Break the code and find the murder! Did you solve all of them? Great, now for the program (a lot easier if you know the answers) First make a method called answer that returns a String and takes in an int Next make a switch statement which compares the int parameter with a case for each riddle and then returns the answer for the specified riddle o Example: case 1: return Ans1 There are two special cases oFor case 2 (riddle 2) you have to use String.format to return a string that contains (you can copy and paste): The sisters have one brother so 1+6+2-90?” (Replace the ? with the appropriate letter o The other special case will be the default case. This case will be the answer to the murder mystery, to return the answer you have to concatenate every item in the array arr to the class variable str using a for loop. Then return str
limport 5ava.util. Scaneri 1 import java.util.scanner 3 /Write a method called answer() here param: an int which represents the riddle number 5 return: a String that has the answer 6 The Answers are below the main method as class variables 9 public class SolveIt 1 public static void main(Stringt] args) f Scanner scnr-new Scanner(System.in); SolveIt lab -new SolveIt(O; scanner scn new Scanner(System.in); int num = scn.nextInt(); System.out.printin(lab.answer(num)) //These are the answers not in the right order 6 String AnsM”Mount Everest” 9 String AnsP”A penny” String AnsC “Your breath!”; int AnsN = 9; String AnsF “Fire”; 0 String AnsG-“Gloves” String[] arr {“B”,”il”,”1 J”,”ack”,”son !”); string str “The Murder is ”

Expert Answer


Answer to This Lab will have you make a program which returns the answer to six riddles and one murder mystery. You can try solvin… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *