PRG/420: Java Programming – 4 LABS

(LAB 1) Mad Lib - Loops   Mad Libs are activities that accept a idiosyncratic cater sundry say, which are then used to perfect a scanty anecdote in unforeseen (and hopefully comical) ways. Write a program that takes a string and integer as input, and outputs a phrase using those items as underneath. The program repeats until the input string is discharge 0. Ex: If the input is: apples 5 shoes 2 discharge 0 the output is: Eating 5 apples a day keeps the savant abroad. Eating 2 shoes a day keeps the savant abroad. Note: This is a lab from a foregoing provision that now requires the use of a loop.   (LAB 2) Varied totality of input facts   Statistics are frequently congenial delay varying totalitys of input facts. Write a program that takes any calculate of non-denying integers as input, and outputs the middle and max. A denying integer ends the input and is not interjacent in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 You can feign that at lowest one non-denying integer is input. (LAB 3) Checker for integer string   Forms frequently apportion a user to invade an integer. Write a program that takes in a string representing an integer as input, and outputs yes if integral sign is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() discharge. (LAB 4) Remove spaces Write a program that removes all spaces from the given input. Ex: If the input is: Hello my call is John. the output is: HellomynameisJohn.