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

Write a program to test your class MyStringTest. import java.util.Scanner; class

ID: 3540553 • Letter: W

Question

Write a program to test your class MyStringTest.



import java.util.Scanner;
class MyStringTest {

      public static void main(String[] args){
         
         String str ;
            Scanner keyboard = new Scanner(System.in);
      
         //Enter String Input
                System.out.print("Enter string:");
                    str = keyboard.nextLine();
         //Reverse Order
            System.out.print("The Reverse order is:");
                for (int i= str.length()-1; i >= 0; i--)
            System.out.print(str.charAt(i));
         //Exit Program
           System.exit(0);
        }
}

Explanation / Answer



// testing below program.

// save below file as MyStringTest.java

// compile as javac MyStringTest.java

// now run java MyStringTest

// now it asks for Enter string:

// give any string name for ex. Aswani

// now it prints The Reverse order is: inswsA


// thats it program is TESTED.

// if u need any help let me know


import java.util.Scanner;
class MyStringTest {

      public static void main(String[] args){
         
         String str ;
            Scanner keyboard = new Scanner(System.in);
      
         //Enter String Input
                System.out.print("Enter string:");
                    str = keyboard.nextLine();
         //Reverse Order
            System.out.print("The Reverse order is:");
                for (int i= str.length()-1; i >= 0; i--)
            System.out.print(str.charAt(i));
         //Exit Program
           System.exit(0);
        }
}

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