Programming

PRG/420 Java Programming 4 LABS

(LAB 1) Count input length without spaces, periods, or commasGiven a line of text as input, output the number of characters excluding spaces, periods, or commas.Ex: If the input is:Listen, Mr. Jones, calm down.the output is:21Note: Account for all characters that aren’t spaces, periods, or commas (Ex: “r”, “2”, “!”).(LAB 2) LAB: Output range with increment of 10Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.Ex: If the input is:-15 30the output is:-15 -5 5 15 25Ex: If the second integer is less than the first as in:20 5the output is:Second integer can’t be less than the first.For coding simplicity, output a space after every integer, including the last.(LAB 3) Print string in reverseWrite a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters “Quit”, “quit”, or “q” for the line of text.Ex: If the input is:Hello thereHeyquitthe output is:ereht olleHyeH(LAB 4) PalindromeA palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: “bob,” “sees,” or “never odd or even” (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.Ex: If the input is:bobthe output is:bob is a palindromeEx: If the input is:bobbythe output is:bobby is not a palindromeHint: Start by just handling single-word input, and submit for grading. Once passing single-word test cases, extend the program to handle phrases. If the input is a phrase, remove or ignore spaces.18/05/202060informationsystems

Back To Top