Java #9: How To Change A String From Lower Case to Upper Case

//Reading in the string
preChange = wordReader.nextLine();

//Changing the string to upper
afterChange = preChange.toUpperCase();

//Printing out the changed string
System.out.println(“Nah Say it like this: “+afterChange+”!”);

 

//Programmer:Akinwale Owi
//Program Purpose: Lower To Uppercase
//Company:Dagba Computers
//——————————————————

//package name
package dagba.computers;

//imports
import java.util.Scanner;

//class name
public class DagbaComputers {

//main function
public static void main(String[] args)
{

//Creation of Scanner
Scanner wordReader = new Scanner (System.in);

//String Variables
String preChange, afterChange;

//Asking the user for a string to change
System.out.println(“How excited are you to learn java?”);

//Reading in the string
preChange = wordReader.nextLine();

//Changing the string to upper
afterChange = preChange.toUpperCase();

//Printing out the changed string
System.out.println(“Nah Say it like this: “+afterChange+”!”);

}//End of main function

}//end of DagbaComputers Class

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: