Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a java program to iterate over characters of a string to replace every occurrence of 'm' with a star based on the following

image text in transcribed
1. 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) Sample output: Please enter your String: I would love to improve my programming skills The number of characters that have been changed is: 4 The new string is: I would love to i*prove my progra**ing skills Please enter your String: I will take Business Intelligence very soon The number of characters that have been changed is: 0 The new string is: I will take Business Intelligence very soon

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started