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 area would a Gaming Designer fall under? Research and explain why you think so. Make sure to site your source and where yo
pshichka [43]

Answer: Game Artist, Game Designer or Game Programmer.

Explanation:

All of which fall under a “Game Designer”

5 0
3 years ago
What do you think will happen if you use a different file format for a certain document type?
sweet-ann [11.9K]

Answer:

It will either convert the file automatically into the program so you can edit it on the different platform or it will not be able to open the document at all.

Explanation:

I have personally done this before. Usually I use Word documents, which are .doc and .docx files.

I also run a Linux based OS sometimes (dual boot) and I don't have Microsoft Office products on it. However, Linux does have their own set of products that are similar to it.

I opened a .docx file on the Linux version of Word and it did convert the file into a separate one and I was able to edit it.

However, when I then tried opening the new Linux file type on Word, it was not able to open the document at all.

Therefore, it really depends on what programs have what capabilities. Word can open .doc and .docx. Linux could open their own types as well as .doc and .docx by conversion.

A rule of thumb is just not to change the file format at all. Just stick with the original so you don't lose your file. If you cannot do so, then use a online file converter to change the file type.

3 0
3 years ago
What's your thoughts on people using Brainly to cheat academically?
lys-0071 [83]

Answer:

At this point, school isnt even about learning anymore. Its just about passing so you dont end up being a dropout or just a bum in general cause not everyone has the skills to make something out of nothing.

Explanation:

7 0
3 years ago
Read 2 more answers
_______________ when operating in an extremely time-constrained environment. They offer the advantage of rapid distribution, but
Alex Ar [27]

Verbal Order

Explanation:

A fragmentary order (FRAGORD) informs units that one or more elements of the base order have changed that eliminates the need for restating information contained in a basic operation order.  

It is issued after an operation order to change or modify that order.

Verbal order is used when operating in an extremely time-constrained environment.

They offer the advantage of rapid distribution, but they risk important information being overlooked or misunderstood.

They are usually followed by written FRAGORDs .

Verbal orders must only be used in emergency  situations or when the prescriber is unable to  document the order.

5 0
3 years ago
Solve the equation w - 2 = -3<br><img src="https://tex.z-dn.net/?f=w%20%3D%20%20%20-%20%20%5Cfrac%7B3%7D%7B2%7D%20" id="TexFormu
Andreyy89
Heres my answer w= -1
4 0
3 years ago
Other questions:
  • I have one big question <br><br><br> WHAT CAN I DO WHEN I'M BORED
    6·2 answers
  • Mention any six profession related to tourism
    6·2 answers
  • Write a program that prompts the user for an integer, then asks the user to enter that many values. Store these values in an arr
    14·1 answer
  • Think of an example in your life where a number could be described as data, information, and knowledge
    14·1 answer
  • You want to use a computer to make a painting of your backyard to go along with a story you wrote. Which software would be appro
    8·1 answer
  • Which of the following is not true?A. An organization may express its cybersecurity state through a Current Profile to report re
    10·1 answer
  • In what type of attack does the attacker have the ciphertext of several messages that were encrypted with the same encryption al
    14·1 answer
  • What is the recipe for enchanting table?
    14·2 answers
  • Advantages and disadvantages of a watch tower​
    15·1 answer
  • Choose the output result of the below code.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!