Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please do it in java Write a method named showchar. The method should accept two arguments: a string object and an integer. The integer argument

image text in transcribed

please do it in java

Write a method named showchar. The method should accept two arguments: a string object and an integer. The integer argument is a character position within the string, with the first character being at positio 0. When the method executes, it should display the character at the specified character position. The method does not return anything. Here is an example of a call to the method: showChar ("New York", 2) ; In this call, the method will display the character w because it is in position 2. Demonstrate the method in a complete program that asks the user to enter a line of text and an index. Here is a sample run of the program: Enter a line of text: Jack and Jill ran up thehill. Enter your index: 14 r In the sample run shown above, look carefully at the wording of the prompts and the placement of spaces and colons. Your program's output must match this. The name of your program class should be Method_showChar

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

More Books

Students also viewed these Databases questions

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago