Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The goal of this problem is to build on the previous exercise and make an additional user-defined method that can take multiple suspects with an
The goal of this problem is to build on the previous exercise and make an additional user-defined method that can take multiple suspects with an alibi as input and output the murderer. You will add a new method called "identify Murderer" and call it from your main method. You will print out the return value of your new method in the main method. Instead of having an eye-witness who can pinpoint the murderer, the detective has heard that two of the suspects have alibis (i.e. a witness can confirm that they were not the murderer). You will gather input on which of these two suspects are not the murderer, and use that to identify the murderer and output the murder message as described in parts 1 and 2. Again, make sure to handle various cases for names. Example input: AMOS kevin Example output: Who was the first person with an alibi? Who was the second person with an alibi? It was Juan with the candlestick! (1) Copy your murderer Message method from the previous exercise: ** * Determines the detective's message. The input should be case insensitive. * @param murderer the murderer. * @return The detective's message for a given murderer. */ public static String murdererMessage (String murderer) { // FILL IN BODY (2) Complete the following method: * Determines the murderer based on two alibis. The input should be case insensitive. * @param alibil the first suspect who has an alibi. * @param alibi2 the second suspect who has an alibi. * @return the murderer or "unknown" if it can't be deduced public static String identifyMurderer (String alibil, String alibi2) { // FILL IN BODY 2 import java.util.Scanner; public class Clue{ public static void main(String[] args) { /* Get user input and use your method here*/ /* Add your methods here */ } The goal of this problem is to build on the previous exercise and make an additional user-defined method that can take multiple suspects with an alibi as input and output the murderer. You will add a new method called "identify Murderer" and call it from your main method. You will print out the return value of your new method in the main method. Instead of having an eye-witness who can pinpoint the murderer, the detective has heard that two of the suspects have alibis (i.e. a witness can confirm that they were not the murderer). You will gather input on which of these two suspects are not the murderer, and use that to identify the murderer and output the murder message as described in parts 1 and 2. Again, make sure to handle various cases for names. Example input: AMOS kevin Example output: Who was the first person with an alibi? Who was the second person with an alibi? It was Juan with the candlestick! (1) Copy your murderer Message method from the previous exercise: ** * Determines the detective's message. The input should be case insensitive. * @param murderer the murderer. * @return The detective's message for a given murderer. */ public static String murdererMessage (String murderer) { // FILL IN BODY (2) Complete the following method: * Determines the murderer based on two alibis. The input should be case insensitive. * @param alibil the first suspect who has an alibi. * @param alibi2 the second suspect who has an alibi. * @return the murderer or "unknown" if it can't be deduced public static String identifyMurderer (String alibil, String alibi2) { // FILL IN BODY 2 import java.util.Scanner; public class Clue{ public static void main(String[] args) { /* Get user input and use your method here*/ /* Add your methods here */ }
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