Write a program that prompts the user to input a string


The assignment is Write a program that prompts the user to input a string and then outputs the string in uppercase letters. (Use an array of characters [or char] to store the string.)
I keep getting an error for my code cannot find symbol:
symbol : method toUpperCase()
location: class java.lang.String[]
System.out.println("n" + "The string converted to uppercase letters is " + (str.toUpperCase()));
My code for this is 
{
static Scanner console = new Scanner(System.in);

public static void main(String[] args)
{

String[] str = new String[30];

for (int index = 0; index < str.length; index++)
{
System.out.print("Please enter a string of characters with no spaces " + str.length);
str[index] = console.next(); 
System.out.println();

if (index < (str.length)) 

System.out.println();
}

System.out.println("n" + "The string converted to uppercase letters is " + (str.toUpperCase()));
}
}
What am I doing wrong? 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program that prompts the user to input a string
Reference No:- TGS0134368

Expected delivery within 24 Hours