Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java problem. Write a program that manipulates two strings. The program inputs two strings (string1 and string2) and a character (char1) and an integer (position)

Java problem. Write a program that manipulates two strings. The program inputs two strings (string1 and string2) and a character (char1) and an integer (position) to represent a character position within a string. The program will display the following: 1. Whether string1 is less, greater or equal to string2 2. string1 in upper case 3. string2 in lower case 4. The number of characters in string1 5. The first character in string2 6. The number of occurrences that char1 is contained in string1. Hint: use a for loop and charAt 7. The character that is in the position of string1. Turn in a run of the program that uses your first and last names as the strings. Use at least two methods with the following headers: int countOccurrences(String s, char c) // to answer #6 char showChar(String s, int pos)// to answer #7

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions