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
A person's oral communication skills can give either a positive or negative first impression.
ratelena [41]

Answer:

true

Explanation:

oral communication can be awkward or good.

5 0
3 years ago
Computer is created by aliens?!
andriy [413]
The computer was invented by <span>Tom Warburton.</span>
7 0
4 years ago
What statement best describes operating systems?
arlik [135]

Answer: D) Operating Systems manage the computer's random access memory (RAM)

Explanation:

It's not A because all modern computers use some form of an Operating System.

It's not B because some Operating Systems can cost hundreds of dollars.

While C has some truth to it, it's reversed. Operating Systems are there to manage and allocate system resources, and D is the better choice.

6 0
3 years ago
Anyone play Ps4 and wanna run up some warzone or Gta? Im M 16 so dont be a creep... :) ill mark brainliest if you drop gamertag
Nikitich [7]

Answer:

Xbox/ PC game here

Explanation:

4 0
3 years ago
Read 2 more answers
This feature in Word Online allows you to view your document to see what it will look like when printed.
kherson [118]

Answer:

Print preview allows you to view your document before printing

7 0
3 years ago
Read 2 more answers
Other questions:
  • What component has the job of managing data as it flows into and out of the places it needs to go?
    11·2 answers
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An ho
    12·1 answer
  • In python,_______ are used to define the conditions necessary for a while loop to run.
    7·2 answers
  • An IT firm came across a startup company that offers a new system of computer storage. It is currently in the experimental phase
    11·1 answer
  • Decision making at the executive or strategic level requires business intelligence and knowledge to support the uncertainty and
    12·1 answer
  • 4. What are the ethical issues of using password cracker and recovery tools? Are there any limitations, policies, or regulations
    5·1 answer
  • Someone please tell me please y my ps4 controller won’t charge:(
    12·2 answers
  • What are the five Ws?<br> (I don’t even know what this means)
    5·2 answers
  • The _____ layer addresses how the software will execute on specific computers and networks.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!