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]
3 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]3 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
Apache web server is the most widely used network operating system used on web servers.
Zarrin [17]
The statement that Apache web server is the most widely used network operating system used on web servers is true. This server runs on <span>67% of all webservers in the world</span>
The Apache web server is a free and open-source cross-platform HTTP Server,<span> developed and maintained by </span>Apache Software Foundation.
7 0
2 years ago
Read 2 more answers
The benefits for a cad proram is: (points : 2) 1 accuracy 2 repeatability 3 simplicity 4 all of the above
NARA [144]
<span>ALL OF THE ABOVE. The benefits for a CAD program is accuracy, repeatability, simplicity.</span>
4 0
3 years ago
Heeeeeeelp :)<br><br> hwjkwdlfo;pk
Rasek [7]

Answer: C u use schoology too :D

Explanation:

7 0
2 years ago
ANSWER QUICKLY!
patriot [66]

Answer:

It is bit { measurement used to quantify computer data. }

7 0
3 years ago
You are working with an older relative who is writing their last will and testament and you two are sharing the document back an
zloy xaker [14]

Answer:

In word there is a setting where you can mange all of user's permission in the document. These are a few permission settings: Read only and Can edit.

6 0
3 years ago
Other questions:
  • Which of the following is not a typical step in the ethical hacking process? A. Planning B. Discovery C. Attack D. Recovery
    5·1 answer
  • Please Help!! Digital Information Technology Class!!
    12·2 answers
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    9·2 answers
  • Without any formal planning, the president of a software company remarks in a speech that new technologically advanced software
    12·1 answer
  • Which type of microphone uses two metal plates?
    7·1 answer
  • Use the drop-down tool to select the word or phrase that completes each sentence.
    7·1 answer
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • You are shooting water balloons with a slingshot. One water balloon goes twice as far as another. Which of the following is the
    8·1 answer
  • Describe your previous personal or professional experience with Microsoft Word.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!