answer.
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
atroni [7]
2 years ago
14

Write a recursive, string-valued method, replace, that accepts a string and returns a new string consisting of the original stri

ng with each blank replaced with an asterisk (*) Replacing the blanks in a string involves: Nothing if the string is empty Otherwise: If the first character is not a blank, simply concatenate it with the result of replacing the rest of the string If the first character Is a blank, concatenate an * with the result of replacing the rest of the string.
Computers and Technology
1 answer:
ch4aika [34]2 years ago
3 0

Answer:

Check the explanation

Explanation:

public String replace(String sentence){

  if(sentence.isEmpty()) return sentence;

  if(sentence.charAt(0) == ' ')

     return '*' + replace(sentence.substring(1,sentence.length()));

  else

     return sentence.charAt(0) +            replace(sentence.substring(1,sentence.length()));

You might be interested in
1. PLCs were originally designed as replacements for: a) microcomputers. c) analog controllers. b) relay control panels. d) digi
timama [110]

Answer:

PLCs (Programmable logic controller) were original designed as replacement for relay control panels.  Relay is another word for a switch. Relay control panels were made for the control of electronic instrumentents or devices. Later on PLCs were made to replace these timers and relay control panels. PLCs are more reliable, flexible and can work better in the harsh environmental situations then the relay control panels.

3 0
2 years ago
Write a public static method named printArray, that takes two arguments. The first argument is an Array of int and the second ar
Serjik [45]

Answer:

Written in Java

public static void printArray(int myarr[], String s){

       for(int i = 0; i<myarr.length;i++){

           System.out.print(myarr[i]+s);

       }

   }

Explanation:

This defines the static method alongside the array and the string variable

public static void printArray(int myarr[], String s){

The following iteration iterates through the elements of the array

       for(int i = 0; i<myarr.length;i++){

This line prints each element of the array followed by the string literal

           System.out.print(myarr[i]+s);

       }

   }

The method can be called from main using:

<em>printArray(myarr,s);</em>

Where myarr and s are local variables of the main

5 0
2 years ago
ACCOUNTING
ivann1987 [24]

last question is D

Hope this helps

7 0
2 years ago
Read 2 more answers
The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho
faust18 [17]

Answer:

Answered below

Explanation:

// Python implementation

incrementAmount = 5

basePrice = 10

price = 0

arrivalHour = int(input("Enter arrival hour 0-12: ")

if arrivalHour < 0 or arrivalHour > 12:

print ("Invalid hour")

if arrivalHour == 0:

price = basePrice

else:

price = arrivalHour * incrementAmount

totalPrice = price + basePrice

if totalPrice > 53:

totalPrice = 53

print ("Your bill is $totalPrice")

4 0
2 years ago
Which one of the following features can control left and right indents using markers?        A. Ruler   B. Navigation pane   C.
Marat540 [252]
The correct option is D; STYLES PANE.
Indentation refers to the distance of a paragraph from the left or the right of a margin. It can also refer to the spacing in a document. 
A style refers to a set of formatting instructions. Microsoft word normally applies the chosen formatting commands when we apply a style. To control the left or the right indent in a document using markers, one has to use the styles pane.

3 0
2 years ago
Read 2 more answers
Other questions:
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
  • What are common names for some primary discrete components used on circuit boards?
    13·1 answer
  • A client is asking for a printing solution that will print three sheets of paper with identical information on each page with a
    13·1 answer
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • 3. Choosing a pre-formatted presentation (that already has a design in the slides) is called choosing a ?
    6·1 answer
  • What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test
    15·1 answer
  • (a) Show how to use (the Boolean formula satisfiability program) satisfiable num (and substitute) to find a satisfying assignmen
    9·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • Distinguish among packet filtering firewalls, stateful inspection firewalls, and proxy firewalls. A thorough answer will require
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!