Computers and Technology
Computers and Technology, 13.11.2020 01:00, doversu

PLEASE HELP asap 60 POINTS needs to be in Java

A programmer has written a method called replaceLetter that counts the amount of times a letter is present in a word. Your job is to modify this existing method to fulfill a new purpose.

Rather than count the instances of a letter in a String, write a program that replaces all instance of one letter with another. You should directly modify replaceLetter to get this program to work. In the starter code, replaceLetter only has two parameter values. Your new version should have a third parameter to indicate which String value is replacing the existing letter.

For example,

replaceLetter("hello", "l", "y")
returns

"heyyo"
Sample output:

Enter your word:
hello

Enter the letter you want to replace:
l

Enter the replacing letter:
x
hexxo
Hint: The letters will be assigned from the user as String values. Make sure to use String methods to compare them!

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 23:30, ayjahj
What can you prevent issues related to downloading content form the internet
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, cardsqueen
Which option completes the explanation for conflict of interest in an organization
Answers: 1
image
Computers and Technology, 24.06.2019 21:30, zlyzoh
Write an algorithm to check if a number is even or odd and show with flow chart step by step
Answers: 2
image
Computers and Technology, 25.06.2019 08:20, dkckdkcekkxgmaipcom
The binary numbering system uses only two symbols—the digits 0 and 1—to represent all possible numbers. - true or false
Answers: 3
Do you know the correct answer?
PLEASE HELP asap 60 POINTS needs to be in Java

A programmer has written a method called...

Questions in other subjects:

Konu
Social Studies, 21.11.2019 20:31