Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

specs for StringMethods Write a public class call StringMethods with a main method.what it does:0. prompt user for a String1. prompt user for an int2.

specs for StringMethods

Write a public class call StringMethods with a main method.what it does:0. prompt user for a String1. prompt user for an int2. if integer is greater or equal than 10 go back to step 03. if integer is 0 end program4. if String starts with 0, end program5. if integer is between 1 and 10 (inclusive) perform the operationand print the message that matches the examples belowRestrictions: do not use anything we haven't covered in class.

Examples

% java StringMethods enter a string (end with 0): abcABC123 enter an int (end with 0): 1 upper case: ABCABC123 enter a string (end with 0): abcABC123 enter an int (end with 0): 2 lower case: abcabc123 enter a string (end with 0): abcABC123 enter an int (end with 0): 3 replace all a's by "foo": foobcABC123 enter a string (end with 0): abcABC123 enter an int (end with 0): 4 a b c A B C 1 2 3 enter a string (end with 0): abcABC123 enter an int (end with 0): 5 first: a last: 3 enter a string (end with 0): abcABC123 enter an int (end with 0): 6 it doesn't contain 'z' enter a string (end with 0): abcABC123 enter an int (end with 0): 7 reverse: 321CBAcba enter a string (end with 0): 8 enter an int (end with 0): 8 string is too short enter a string (end with 0): abcABC123 enter an int (end with 0): 8 substring from 3rd character to end: cABC123 enter a string (end with 0): a enter an int (end with 0): 9 string is too short enter a string (end with 0): abcABC123 enter an int (end with 0): 9 substring from 2nd character to 4th (inclusive): bcA enter a string (end with 0): a enter an int (end with 0): 10 'z' does not appear in second half enter a string (end with 0): abcABC1z23 enter an int (end with 0): 10 'z' appears in second half enter a string (end with 0): aazaa enter an int (end with 0): 10 'z' does not appear in second half enter a string (end with 0): abc enter an int (end with 0): 11 enter a string (end with 0): 0 %

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

9781119563099

Students also viewed these Programming questions

Question

What are the different types of drones?

Answered: 1 week ago

Question

What are the applications of drones?

Answered: 1 week ago

Question

What are the various protocols in telecom domain?

Answered: 1 week ago

Question

What are the various types of routing protocols?

Answered: 1 week ago