The Question

Write a java program called Q2.java that will do the following:

prompt for and reads in a line of text and print out the input text with each 'a' in the input text replaced by a '*'. So, for example, for the input
All the world is a stage
the program should output
All the world is * st*ge
The output should conform to that in the sample runs of a correct program shown below. Note that, in these sample runs, the % sign is not part of the output. User input is shown on the same line as the prompt.

Sample Runs

% java Q2
Enter a line of text ... an example line
The changed line is: *n ex*mple line
%
% java Q2
Enter a line of text ... nothing here
The changed line is: nothing here
%

Useful APIs

Here (again) are the common APIs that you may access:

Java 1.5 API
Type API

Submitting Your Work

Here is the command to submit your work (further details regarding the submit command can also be obtained by typing man submit
Once again, you are encouraged to submit regularly. Newer submissions overwrite older ones.

submit 1020 midtermW7 Q2.java