Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4.18 Ch 4 Program, Part 3: Clue Deduction The goal of this problem is to build on the previous exercise and make an additional user-defined

image text in transcribed

4.18 Ch 4 Program, Part 3: Clue Deduction 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 Before turning in, remember to Style and Comment following the course standards CS 200 Style. Created by Amos - Reviewed by Kevin 4.18 Ch 4 Program, Part 3: Clue Deduction 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 Before turning in, remember to Style and Comment following the course standards CS 200 Style. Created by Amos - Reviewed by Kevin

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions