Question: Lab1: Please view the sample Java files provided: TestString and StringExamples. They may be useful for completing the class assignment. (5 points) Write a class,

Lab1: Please view the sample Java files provided: TestString and StringExamples. They may be useful for completing the class assignment. (5 points) Write a class, xxxx_StringLab1 (where xxxx is your Kean id), with a main method. Include the following: o Using the methods of String produce the output in the following slide. o You must use the methods indicated on the slide following the output o This is an individual assignment. o Submit on Blackboard by 11/4 o Declare a String variable in your class. The content of the String is Kean University Using the String and the methods of the String class, print the following lines (you do not have to print the line numbers at the beginning of each line; they are there so I can show you want method I want you to use in the next section). 1) The number of characters is 15 2) The String in lower case is kean university 3) The String in upper case is KEAN UNIVERSITY 4) The first 6 characters of the String is Kean U 5) The rest of the characters in the String are niversity 6) The U in the String is at position 5 7) The u in the String is at position -1 8) The o in the String is at position -1 9) A new String where University is replaced with U Kean U 10)The original String has not changed Kean University For each line use the methods to the right of the line: 1) The number of characters is 15 (length) 2) The String in lower case is kean university (toLowerCase) 3) The String in upper case is KEAN UNIVERSITY (toUpperCase) 4) The first 6 characters of the String is Kean U (substring) 5) The rest of the characters in the String are niversity (substring) 6) The U in the String is at position 5 (indexOf) 7) The u in the String is at position -1 (indexOf) 8) The o in the String is at position -1 (indexOf) 9) A new String where University is replaced with U Kean U (replace) 10)The original String has not changed Kean University (none) CPS 2231 String Labs Fall 2017 Lab2: Write a class xxxx_StringLab2 (where xxxx is your Kean id), with a main method which does the following: (5 points) 1) Asks the user for first name and then last name (2 separate inputs) 2) Using a Scanner gets the first name and last name 3) Using the methods of String, prints the initials in upper case 4) Generates a password which consists of the following concatenated and in lower case: a. First 3 letters of the last name b. Length of the first name c. First 3 letters of the first name Sample Run: Enter the first name Mary Enter the last name Jones Your initials are: MJ Your password will be jon4mar

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!