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

I need to do create the following programs, with more than one header. A main he

ID: 3633611 • Letter: I

Question

I need to do create the following programs, with more than one header. A main header, then two or more different headers (public class)

Write a Java program that includes a method named showChar. The method accepts two arguments: the first argument is a String and the second argument is a number represents a character position within the String. When the method executes, it should return the character at that character position. Your main method will do the following:

prompt the user to input a String and a character position.

Then call the method to get the character at the position the user entered.
display the result.

Explanation / Answer

This didn't work for me i got the following errors:


error: unclosed string literal

System.out.println("Character at position "+pos+"


error: ';' expected

System.out.println("Character at position "+pos+"

error: illegal start of expression

is:"+val.charAt(pos));

error: unclosed string literal

is:"+val.charAt(pos));

^