Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use java please Exercise 2. Write a program that first asks a user to enter two words and a letter. Then print the first word

image text in transcribedUse java please

Exercise 2. Write a program that first asks a user to enter two words and a letter. Then print the first word in uppercase letters and the second word in lowercase letters. Print out the number of letters in both words, how many times the inputted letter occurs in both words, and which positions in each word the letter occurs (assuming zero-indexed strings). After this, print whether the words are the same or not, and finally print out both words backwards. You can use either a while loop or for loop if needed for this exercise.* Sample output: Enter two word: School House Enter a letter: o SCHOOL house There are 6 letters in School There are 5 letters in House There are 2 o's in School There are 1 o's in House o occurs in positions: 3 4 in school o occurs in positions: 1 in House School and House are not the same words. loohcs esuoH

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions