subject

Write a main( ) method that declares a String reference variable. Read a sentence (with spaces) using keyboard input. Create a String object using this input. Input a sentence that is long enough and has enough letters to accomplish each of the following tasks. Write the String method calls and print the output for each of these tasks. Note that some of these cannot be written with one line of code and one String class method call. Print the number of characters your sentence contains. Print the first letter of your sentence Print the last letter of your sentence Print whether your sentence contains the letter β€˜e’ Print whether your sentence contains "ay" or not. Print the number of times the letter β€˜e’ appears in your sentence Find the position of the last occurrence of the letter β€˜e’ in your sentence Find the position of the second occurrence of the letter β€˜e in your sentence Print how many characters your sentence contains besides the space character. Add the words "you know" to the sentence Print a completely upper case version of your sentence Extract and print a substring of five characters from your sentence Print a String where all the chars β€˜a’ are replaced with the char β€˜x’ Step 3: Write a project to perform manipulations on a string of characters. Write a program that will allow the user to change every occurrence of the space character with the string, "blank". Create two classes. Replacer class, which has at least two fields, the original string, stored in a String object and the converted string, stored in a StringBuilder object. The constructor method should take a String as a parameter and assign it to both fields. You need a replace( ) method that will take in two parameters, the character to be replaced and the sequence of characters to replace it with. This method will use StringBuilder methods and logic to change all occurrences of the original string to a new string, while still preserving a copy of the original string. Write a get( ) method to get the original string. Write a get( ) method to get the converted string. Write a set( ) method to change the original string to a new string provided by the user. Driver class: Write a class with the main( ) method that tests your Replacer class. The user can enter strings, and convert each to another string using the replace( ) method that you wrote. Use the get( ) methods to print results to the screen. Allow the user to enter a brand new string until they decide they are done.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:20
What’s resistance in an electrical circuit ?
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print β€œbad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
You know the right answer?
Write a main( ) method that declares a String reference variable. Read a sentence (with spaces) usin...
Questions
question
History, 19.12.2019 06:31
question
Computers and Technology, 19.12.2019 06:31
question
Mathematics, 19.12.2019 06:31
Questions on the website: 13722362