Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WRITE IN JAVA Project 3: LetterFinderAA.java Write a program that will ask the user to input a phrase (multiple words) and a letter. You will

WRITE IN JAVA

Project 3: LetterFinderAA.java

Write a program that will ask the user to input a phrase (multiple words) and a letter. You will tell them at which index their chosen letter can be found in their sentence. This task needs to be set up in a static method. Create the method so that it takes the sentence and the letter as input parameters and will return an integer. For example, if the sentence is Hello Cat and the users letter is o, your method should return 4. Your static method should not do any inputting or outputting. That part should be in your main method. You should allow the user to enter new sentences and letters until they chose to be done. Set it up so that if they type done as their sentence, the program ends. Also, you should inform the user if the character that theyve entered does not exist in the sentence. See below.

Output Example (User input is marked with >>>. Everything else is what you print to the screen.)

This program will tell you where a certain character is in a sentence. Please enter a sentence. (Type the word done to exit.)

>>> Dogs drool.

Please enter the letter youd like to find:

>>> l

That character is located at index 9.

This program will tell you where a certain character is in a sentence. Please enter a sentence. (Type the word done to exit.)

>>> I love pizza.

Please enter the letter youd like to find:

>>> X

That character is not present in your sentence.

This program will tell you where a certain character is in a sentence. Please enter a sentence. (Type the word done to exit.)

>>> done

Goodbye.

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

1. Make sure you can defend the grade in the first place.

Answered: 1 week ago

Question

Develop clear policy statements.

Answered: 1 week ago

Question

Draft a business plan.

Answered: 1 week ago

Question

Describe the guidelines for appropriate use of the direct plan.

Answered: 1 week ago