Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a method to reverse the case of a string 1. Add a new method called reverseCase with the following format: It is a public

Write a method to reverse the case of a string

1. Add a new method called reverseCase with the following format: It is a public method, so "anyone" can call it. It is static, which means that it doesn't need an object to be called. It returns a String value to the calling function. It takes one parameter of type String.

2. Precondition: The String parameter is not equal to null.

3. Postcondition: The method returns the same String, but uppercase letters have been made lowercase and vice versa Digits and special characters should not be changed

4. You may want to use the Character wrapper class, which has methods such as isUpperCase(), isLowerCase(), toUpperCase(), and toLowerCase().

5. You must use a for or while loop to complete this method.

6. Test reverseCase in your main method.

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions