Question: please do it with java 4) Read in an integer named year from the keyboard. Write a switch statement for this variable with the follow
4) Read in an integer named year from the keyboard. Write a switch statement for this variable with the follow cases. If the year entered is not in the table, print "Error: that year is not on this timeline" Message to print case 2016 Trump became president 1963 JFK was assassinated 1944 D-Day was successful 1929 The great depression began 5) Write a program that has three menu options: 1) Print a word (prints a word that the user types in from the keyboard) 2) Print a number (print a number that the user types in from the keyboard) 3) Terminate (ends the program) Ask the user to enter one of the following menu options and act accordingly. This menu should keep re- appearing until the user terminates the program. 6) Create an array of size 5. Fill the array with integers that are entered by the user. 7) Write a method that returns the sum of an array of integers. Write another method that returns the average of an array of integers. Write one more method that will display the contents of an array of integers. Using the array from number 6, call each of these methods. 8) Write another method that can search the array for a given value. If the value is found in the array, print "Found it" otherwise print "It's not here". Call this method using the array from number 6. 9) Add JavaDoc comments to each method. 10) Using the file "input.txt", calculate how many lines are in the file (ignore the header row). Then display each line like the statement below (ignore the header). Hello! My name is Dylan Kelly. I am 24 years old and 5 feet 11 inches. 11) Modify number 10 so that it also prints each line to a new file called "output.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
