subject

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?");

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
Var add = function( x, y ) { return ( x + y ); } alert( add (5, 3) ); 11. (refer to code example 2.) the function a. accepts 2 parameters and returns 2 values. b. accepts 2 parameters and returns 1 value. c. accepts 2 parameters and does not return a value. d. does not accept a parameter and returns 1 value.
Answers: 1
question
Computers and Technology, 21.06.2019 16:00
Ihave 25$ on an itunes card and i need to buy spotify premium, i have no other payment method.
Answers: 2
question
Computers and Technology, 22.06.2019 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
You know the right answer?
The goal of this problem is to practice using appropriate branching statements. You will add to the...
Questions
question
Mathematics, 30.03.2021 02:50
question
English, 30.03.2021 02:50
question
Mathematics, 30.03.2021 02:50
question
Mathematics, 30.03.2021 02:50
question
Mathematics, 30.03.2021 02:50
question
Mathematics, 30.03.2021 02:50
question
Mathematics, 30.03.2021 02:50
Questions on the website: 13722362