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
adell [148]
2 years ago
11

Write a function named delete Letter that has 2 parameters. The first parameter is a string, the second parameter is an integer.

The function removes the character located at the position specified by the integer parameter from the string. For example, if the function is being called with the following statement: deleteLetter ("timetable", 3); the string will become "tietable", where the third character, 'm' has been removed.
Computers and Technology
1 answer:
Serjik [45]2 years ago
4 0

Answer:

//import package

import java.util.*;

// class name

class Solution

{

// method to remove the character at given index

public  static void deleteLetter(String st,int in)

{

// remove the character at index in

 st=st.substring(0,in-1)+st.substring(in);

 System.out.println(st);

}

// main method of class

public static void main (String[] args) throws java.lang.Exception

{

   try{

//scanner object to read input

   Scanner scr=new Scanner(System.in);

// read string

   System.out.print("Enter the string:");

                    String st=scr.nextLine();

// read index

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

  int in=scr.nextInt();

// call method

  deleteLetter(st,in);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read a string with the help of Scanner object.Then read the index of character to be remove.Call the method deleteLetter() with parameter string and index.It will make substring from 0 to "in-1" and "in" to last of the string.Then add both the string.This will be the required string.

Output:

Enter the string:timetable

Enter the index:3

tietable

You might be interested in
61:39 A communication sent through Transmission Control Protocol (TCP) arrives out of order. What allows the data to be put back
kobusy [5.1K]

Answer:

Sequence Numbers

Explanation:

In the transmission control protocol, the sequence number are used to put data back in order.

It is the number pattern that follows sequence. This is the number pattern which interprets data before they are returned by the recipient as an acknowledgement with its numbers.

When a sent data is out of order, the sequence number works towards correcting the sequence before sending its acknowledgement.

7 0
2 years ago
Does anybody want to be my friend
Gekata [30.6K]

Answer:

Yeah sure, mines aatelophxbia, i'm 14. what games you play?

6 0
3 years ago
Read 2 more answers
Graphic design has as its goal the communication of some __________ message to a group of people.
Aleks [24]
Graphic design has as its goal the communication of some specific message to a group of people.

Specific is your answer.
3 0
2 years ago
What type of servers are used to store recently accessed DNS records from other domains to avoid incurring the performance overh
Kruka [31]

The correct answer is B. Primary DNS Server.

DNS records are type of data that is equivalent to IP address where the website or domain is located.  DNS records are normally stored in DNS server in a raw or flat file. A host, using port number 53 will send a DNS request to the server. If the computer has stored it's data or record in it's database, it will automatically reply to the requesting host. Example: You typed in www.website.com, if you have a matching DNS record in your server, using an IP address, your server will reply and display the website.

8 0
2 years ago
When should you try to photograph reflections on bodies of water?
Wewaii [24]

Answer:  C. although a rainy day (A) would make it more aesthetic

6 0
3 years ago
Other questions:
  • To differentiate the absolute pathnames to files that are located on different drives, html requires you to include the drive le
    8·1 answer
  • How do Hlookup and Vlookup differ?
    5·2 answers
  • A web page ____ can also create a style sheet that takes precedence over the internal style sheets of browsers.
    10·1 answer
  • ​Microsoft claims that the microsoft project software can _____.
    11·1 answer
  • Given three variables, a, b, c, of type double that have already been declared and initialized, write a statement that prints ea
    10·1 answer
  • What are the purposes of a good web page design?
    9·2 answers
  • Before posting a picture online, make sure to
    7·1 answer
  • What is boolean rules​
    12·1 answer
  • PLS PAK I ANSWER NITO KAILANGAN LANGPO​
    6·1 answer
  • Write a program to output the following quote by Edsger W. Dijkstra:
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!