Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a java program to iterate over characters of a string to replace every occurrence of m with a star * based on the following
Write a java program to iterate over characters of a string to replace every occurrence of m with a star * based on the following requirements:
a. Ask the user to enter any string (2 marks)
b. Use a for loop in your program (4 marks)
c. Please do not use any methods and libraries that have not been discussed in our
lectures.
d. The program should print the number of characters that have been replaced. (2 marks)
e. The program should print the new string (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started