Java Programming 3 Labs

(LAB 1) Count input length without spaces, periods, or commas

Given 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:

21

Note: Account for all characters that aren’t spaces, periods, or commas (Ex: “r”, “2”, “!”).

(LAB 2) LAB: Output range with increment of 10

Write 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 30

the output is:

-15 -5 5 15 25

Ex: If the second integer is less than the first as in:

20 5

the 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 reverse

Write 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 there
Hey
quit

the output is:

ereht olleH
yeH

(LAB 4) Palindrome

A 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:

bob

the output is:

bob is a palindrome

Ex: If the input is:

bobby

the output is:

bobby is not a palindrome

Hint: 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.

Order a Unique Copy of this Paper

Essay Creek is an academic writing service provided to you by, a London-based company.

  • Experience
    Helping students successfully for 11 years.
  • Confidentiality & Security
    Be sure your information will be kept confidential due to our secure service.
  • Quality & Reliability
    8.5 out of 10 average quality score according to our customers' feedback. 97.45% of orders delivered on time.
  • Versatility
    478 active writers in 68 disciplines.
  • 100% money back guarantee
    You can always request a refund if you are not satisfied with the result.

Read more about us

Our team of writers is comprised of people with necessary academic writing skills and experience in various fields of study.

  • Skilled writers only
    We carefully choose writers to employ, paying attention to their skills and abilities.
  • Competence
    Your order will be assigned to a competent writer who specializes in your field of study.
  • In-depth knowledge
    Our writers know both peculiarities of academic writing and paper formatting rules.
  • Motivation
    We keep updated on results our writers show, motivating them to constantly improve their performance.

Read more about our writers

  • Testimonials
    Our clients' testimonials prove we're doing everything right.

Check for yourself

  • Sample essays
    The best way to understand how well our writers do their work is to view sample essays written by them.

View samples

  • Our Free Essay Tools
    Even more opportunities to improve your academic papers.


Bibliography Generator
Words to Pages Converter
Words to Minutes Converter
College GPA Calculator
Thesis statement generator