Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

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

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions