Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i need the codes of these two exercises in java pls Exercise # 1: (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that
i need the codes of these two exercises in java pls
Exercise \# 1: (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between 1 and 12 and then displays the months and its number of days corresponding to the integer entered. Your program should display "wrong number" if the user enters a wrong number by catching ArrayIndexOutOfBoundsException. Exercise \# 2: (Replacing Text) Write a class named ReplaceText that replaces a string in a text file with a new string. The filename and strings are passed as command-line arguments as follows: java ReplaceText sourceFile targetFile oldString newString For example, invoking java ReplaceText FormatString.java t.txt StringBuilder StringBuffer replaces all the occurrences of StringBuilder by StringBuffer in FormatString.java and saves the new file in t.txt 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