1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lutik1710 [3]
3 years ago
6

Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The intege

r argument is a character position within the String, with the first character being at position 0. When the method executes, it should display the character at that 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. Sample Run java Method_showChar Enter a line of text: The elevation of Mount Everest is 29,029 feet (8,848·in·meters)↵ Enter yourindex:3 5↵ 9↵
Computers and Technology
1 answer:
matrenka [14]3 years ago
5 0

A complete program with the method ShowCar:

import java.util.Scanner; // header file

public class ShowChar

{

public static void main(String[] args)

{

String lnOfText;

int i;

Scanner input = new Scanner(System.in);

System.out.print("Enter a line of text:");

lnOfText = input.nextLine();

System.out.print(" Enter your index: ");

i = input.nextInt();

show_Char(lnOfText,i);

}

public static void show_Char(String str_a, int i)

{

System.out.print(str_a.charAt(i));

}

}

In this program, both the inputs ie. a sentence or line of text as well as the index position is obtained. A method is written to find the string at that particular position. Finally the method prints that character at the particular index.

You might be interested in
Which is an example of a zero-point perspective?
kap26 [50]

i think its b sorry if  wrong

4 0
3 years ago
Write a program that accepts 5 number and arrange them in ascending order​
Schach [20]
5
5 does this help?
5
5
5
7 0
3 years ago
To all paladins players out there!!!!!
Alex777 [14]

I am BORED PPL ..........

Explanation:

hi

6 0
3 years ago
"Hubs:
Butoxors [25]

Answer:

Hubs incorporate amplifiers and repeaters.

Explanation:

Hub is an outdated way of connecting ethernet devices, they incorporate amplifiers and repeaters, they do not allow simultaneous communication among connected devices.

The latest technology in connecting ethernet devices are with the use of switch.

7 0
3 years ago
In Scratch, you have to choose backdrops from a limited number in the Scratch image library.
forsale [732]
I would say it would be True
5 0
3 years ago
Other questions:
  • How is IT related to new business initiatives?
    6·1 answer
  • Businesses have taken advantage of many of the smart phone features to promote their business. TRUE OR FALSE
    5·2 answers
  • Write a Java application that inputs a series of 10 integers and determines and prints the largest and smallest integer. Use a c
    12·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Why did artists use pinhole cameras during the renaissance?
    8·1 answer
  • What's a good app that solves trigonometry problems?
    8·1 answer
  • Pictures that you can click on to tell your computer what to do.
    12·2 answers
  • What is Function of print statement?
    8·2 answers
  • Give three general reasons for the importance of computer networking.
    9·1 answer
  • When the user types into a Textbox control, the text is stored in the control's __________ property.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!