Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4.18.1: Ch 4 Program, Part 3: Clue Deduction Pls be in java and have a neat code 4.18 Ch 4 Program, Part 3: Clue Deduction

4.18.1: Ch 4 Program, Part 3: Clue Deduction Pls be in java and have a neat code

image text in transcribedimage text in transcribedimage 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 "identifyMurderer" 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 murderer Message (String 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 LAB ACTIVITY 4.18.1: Ch 4 Program, Part 3: Clue Deduction 0/150 0/15 Clue.java Load default template... 13 // Source or Recipient; Description 14 // Examples: 15 // Jane Doe; helped me with for loop in reverse method 16 // https://docs.oracle.com/javase/tutorial/javautsandbolts/for.html; counting for Loop 18 // John Doe; I helped with switch statement in main method. 19 // 20 m m 80 COLUMNS WIDE 21 import java.util.Scanner; 22 public class Clue public static void main(String[] args) { /* Get user input and use your method here*/ LAB ACTIVITY 4.18.1: Ch 4 Program, Part 3: Clue Deduction 0/15 Clue.java Load default template... 13 // Source or Recipient; Description 14 // Examples: 15 // Jane Doe; helped me with for loop in reverse method 16 // https://docs.oracle.com/javase/tutorial/javautsandbolts/for.html; 17 // counting for loop 18 // John Doe; I helped with switch statement in main method. 19 // 20 ////////////////////////////// 80 COLUMNS WIDE //////////////////////////////// 21 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

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions