hello im kinda of stuck doing a project for my class. ik really need help with number 1, and 4. please help!

here is what i have to do.
1. Use the charAt method to get the first character in firstName and store it in a variable called firstInitial (you will need to declare any variables that you use).
2. Print out the user’s first initial.
3. Use the toUpperCase method to change the fullName to all capitals and store itback into the fullName variable
4. Add a line that prints out the value of fullName and how many characters(including the space) are in the string stored in fullName (use the method lengthto obtain that information).

1. Use the charAt method to get the first character in firstName and store it in a variable called firstInitial (you will need to declare any variables that you use).

You are expect to have variable firstName that should by of String type and you are supposed to declare character variable firstInital

private String firstName;
private char firstInitial
//somewhere along the way you will instantiate  firstName with some value
// then you can instantiate firstInitial
firsInitial = firstName.charAt(0);

Reference for charAt(int index) method, here.

4. Add a line that prints out the value of fullName and how many characters(including the space) are in the string stored in fullName (use the method lengthto obtain that information).

System.out.println("Full name is "+ fullName);
System.out.println("Length of full name is "+ fullName.length() );

References to length() method, here.

PS: Once you read string from user I would use trim() to remove any leading and trailing whitespace
PS2: Next time please be more active as you been given out everything in your assignment description you just need it to look up these thing and put them together

This article has been dead for over six months. Start a new discussion instead.