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
How to use github to creat a blog?Thank you
stepan [7]
You can use GitHub Pages! They have tutorials on their site to help you set up using that (too much for this format!). You can use it to make your own personal site, as well as host any existing site you may have.
5 0
3 years ago
You are the network administrator for a small organization of 100 users. Users till now were freely browsing the Internet. You w
Schach [20]

Answer: Proxy server

Explanation: Proxy server is a type of server that is acts as interface between the network on huge scale and any local network. This server provides the feature of security, operations, privacy etc in the network system. They also help in improving the performance of the network.

It can work as the web filter to eliminate the unwanted websites.They acts as the gateway by  observing the website that is being browsed by the other user.Thus installation of proxy server should implemented on the organization.

8 0
3 years ago
"when a dynamic web page is requested, the web server passes the request to"
nalin [4]
System operations of the website u are  asking to access
7 0
3 years ago
Design a program that will receive a valid time in the 24-hour format (e.g. 2305) and convert to its equivalent 12-hour format (
coldgirl [10]

Answer:

import java.io.*;

public class Main

{

  public static void main(String[] args) throws IOException {

      BufferedReader bufferObject=new BufferedReader(new InputStreamReader(System.in));

      String stringObject=bufferObject.readLine();

      while(!stringObject.equals("99:99AM")){

      System.out.println(convertedTime(stringObject));

      stringObject=bufferObject.readLine();

      }

  }

  public static String convertedTime(String stringObject){

  String s=stringObject.substring(stringObject.length()-2);

  String[] timeObject=stringObject.substring(0,5).split(":");

  if(s.equals("AM")){

  if(timeObject[0].equals("12")) return "00"+timeObject[1];

  else return timeObject[0]+timeObject[1];

  }

  else{

  if(timeObject[0].equals("12")) return "12"+timeObject[1];

  else{

  int hours=Integer.valueOf(timeObject[0]);

  timeObject[0]=String.valueOf(12+hours);

  return timeObject[0]+timeObject[1];

  }

  }

 

  }

}

Explanation:

  • Inside the main method run a while loop until stringObject is not equal to the string "99:99AM".
  • Call the convertedTime method and display the results.
  • Use the same hours and minutes except for 12th hour If the time is in AM.
  • Use "00" instead of 12, if it is 12th hour.
  • Add hours to 12, if the time is in PM and don't change anything in case of 12.
8 0
3 years ago
Question # 1 Multiple Select Which features are important when you plan a program? Select 4 options. Knowing what information is
Black_prince [1.1K]

Answer:

c

Explanation:

7 0
2 years ago
Other questions:
  • Given two ArrayLists of sorted strings (alphabetically ascending), write down a method to merge these sorted strings’ ArrayLists
    10·1 answer
  • Which computer device is used to capture or copy a photograph to place in a report?
    14·1 answer
  • An organization uses SAP financial management software to store accounting details and Microsoft CRM software to record customer
    12·1 answer
  • Write a method named circleArea that accepts the radius of a circle as a parameter (as a real number) and returns the area of a
    12·1 answer
  • As defined by the National Institute of Standards and Technology​ (NIST), "________ is a model for enabling​ ubiquitous, conveni
    11·1 answer
  • Jennifer works as a clerk in a company. The essential function of her job is typing on a keyboard. If she develops crippling art
    11·1 answer
  • When you check your hard drive to see how much space is available, you are checking your
    15·1 answer
  • The goal of this project is to become familiar with basic Python data processing and file usage. By the end of this project, stu
    8·1 answer
  • Your company has a team of remote workers that need to use Windows-based software to develop company applications, but your team
    5·1 answer
  • Pleaseeeee helpppppppp​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!