Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The goal of this problem is to practice using appropriate branching statements. You will add to the main method to take in user input and

image text in transcribedimage text in transcribed

The goal of this problem is to practice using appropriate branching statements. You will add to the main method to take in user input and output a message based on the input. This program emulates a detective questioning an eye-witness of a murder. The detective has three suspects each with a potential murder weapon. Based on the eye-witness's user input, the detective will reach a conclusion about the murderer and the murder weapon. If the witness input is "Amos" the detective will output "It was Amos with the candlestick!" If the witness input is "Kevin", the detective will output "It was Kevin with the revolver!" If the witness input is "Juan", the detective will will output "It was Juan with the lead pipe!" Otherwise, the detective will output "We're not sure who that is. We need to investigate further." Your program should also handle situations where the witness input does not use proper-case. Hint: look at the toUpperCase() or equalsignoreCase() method for Strings. Example input: amos Example output: It was Amos with the candlestick! 2 import java.util.Scanner; public class Clue{ public static void main(String[] args) { Scanner scnr = new Scanner(System.in); System.out.println("Who was the murderer?"); U O ooO /* Add your code here */

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

More Books

Students also viewed these Databases questions