Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Java application that creates an instance of the String class and initia

ID: 3623816 • Letter: W

Question

Write a Java application that creates an instance of the String class and initializes this instance with a String literal. Use a for loop structure to print the string in reverse order. Implement the following two String member methods to complete the assignment.

length( )
charAt( )
Write a program to test your class MyStringTest.

Continue to properly document your source code. Write this program as if you were explaining it to someone new to arrays. Fully document your code in such a way newcomers to Java will understand and be able to implement a Java array. Your grade on this assignment will be based on your thoroughness of documentation as well as you correctness of code.

Compile and run your program until it works and the output looks nice. Add the necessary documentation as described in Course Documents, and then attach your .java file to this assignment. Do not attach the .class file, attach only the .java source code.

Explanation / Answer

Dear, import java.util.Scanner; // Needed for the Scanner class import java.io.*; // Needed for the File class //class class MyStringTest { public static void main(String[] args) { String str ;//variable declaration // Create a Scanner object for keyboard input. Scanner keyboard = new Scanner(System.in); //inputting string System.out.print("Enter string:"); str = keyboard.nextLine(); //Loop to display string reverse for (int i= str.length()-1; i >= 0; i--) System.out.print(str.charAt(i)); //exit program System.exit(0); } //end main } Hope this will help you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote