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
Select the correct answer.
Naddika [18.5K]

Answer:

E

Explanation:

4 0
3 years ago
In the following scenario, which is the least
mario62 [17]

Answer:

Size

Explanation:

Connectivity, they need internet to work.

Speed, they need it to work fast.

Storage, they need space to work.

Size, isn't all that important, unlike the rest.

7 0
3 years ago
When installing a SATA hard drive, is it true or false that you need to move the jumpers on the back of the drive to instruct th
antiseptic1488 [7]

Answer:

This is false.

Explanation:

SATA drives do not have jumpers, because they don't use the master/slave feature. They are connected to the motherboard, and they are ready to work.

The master/slave feature was used by IDE hard drives.15 years ago, most motherboards didn't have too many IDE slots to place more than 1 or 2 HDDs, the IDE cable allowed you to connect 2 drives to 1 cable, greatly increasing your computer's storage space.

It was recommended to set as master the drive connected directly to the motherboard, and the other one as slave.

7 0
3 years ago
Write a SELECT statement that displays each product purchased, the category of the product, the number of each product purchased
Blababa [14]

Answer:

y6ou dont have mind

Explanation:

6 0
3 years ago
Linux distributions automatically come with a native software firewall.TrueFalse
Elodia [21]

Answer:

False.

Explanation:

Ubuntu which is an linux distribution and it is based on debian. Ubuntu does not come with automatic firewall and we also have to manually enable the firewall after installing it otherwise it will be disabled.

You can control the firewall from a graphical interface.

Hence the answer to this question is False.

3 0
3 years ago
Other questions:
  • Sizing handles are used in Microsoft® Word® to _____.
    13·1 answer
  • Please help me with these questions
    5·1 answer
  • What is constructive criticism?
    5·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    9·2 answers
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where element
    9·1 answer
  • Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the
    11·1 answer
  • Pls help... : Slide layouts can be changed by _____.
    9·1 answer
  • Which of the following is true about overloaded methods?
    6·1 answer
  • For some reason my code is not printing in python. It doesn't give me an error is just not printing no thing shows up
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!