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
Julie: 3: 36, 6:72, 9:108....tell me the next 3 ratios * math*
svlad2 [7]

Answer:

12:144, 15:180,

Explanation:

8 0
3 years ago
When you started the vi editor, you forgot to specify the name for the new file you are creating. To save steps next time, how c
zysi [14]
Vi ‘filename’
For example file called main.py
vi main.py
8 0
3 years ago
Amber wants to give her audience copies of her presentation so they can follow along and take notes. What option should Amber ch
blagie [28]

Answer:

Print handouts

Explanation:

I had this question and even if you didn't put the answer options i knew what it was I hope this helped you out (:

6 0
3 years ago
Read 2 more answers
Can you please provide sample rexx code?
Aleks04 [339]

Answer:

/*  My first REXX program  */

say 'Hello world'

Explanation:

REXX is an OS/2 scripting language.

7 0
3 years ago
Predict the future that social media will have on society or the environment
hichkok12 [17]

Answer:

The future that this world holds for Social media may as well be known as the end of self opinions. This is because now  a days many people seek the opinions of others and no longer take there opinions into count. Social media can also damage the environment. This is because since people are on there phone longer bc of social media they also need to charge there phone more, which needs electricity, which comes from the burning of fossil fuels .

5 0
3 years ago
Other questions:
  • How do you subscribe to Darthmaul Productions on YT?
    13·1 answer
  • If you need to reprogramming your gps after you begin driving __.
    15·2 answers
  • How much time does one person spend on social media in one year
    12·2 answers
  • After a new technology is purchased,what are some additional costs that must be incorporated into an upgrade budget?
    6·1 answer
  • Who can effectively use website authoring software?
    6·1 answer
  • What statement would you use to print the phrase Hello, world and then start a new line?
    8·1 answer
  • ____ is a programming language used to view and manipulate data that is stored in a database.
    6·1 answer
  • A student who used a regression model that included indicator variables was upset when receiving only the following output on th
    10·1 answer
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • This is a standard routine used to perform a mathematical task in excel is called?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!