This is what I have so far:
import java.util.Random;
public class Name
{
public static void main (String[]args)
{
String name ="john smith";
String ID1, ID2, ID3;
String firstName="john";
String lastName="smith";
System.out.println("First name: " + firstName);
System.out.println("Last name: " + lastName);
Random generator= new Random();
int num1;
ID2=ID.toUpperCase();
num1=generator.nextInt(31);
System.out.println("ID: " + num1);
}
}
My application is suppose to read a persons first and last name separately. I have to create a string "ID" for that person that contains the first letter of the person's first name, followed by the first 3 characters of the person's last name, which is then followed by a random number in the range 15 - 30. Print this new ID.
I have to create a second ID that converts all letters in the string to uppercase. Print this second ID.
I have to create a third ID that will replace all of the occurrences of the digit 8 and letter A in the second ID. Print this third ID.
Edited by WingedPanther, 17 February 2009 - 08:33 AM.
add code tags (the # button)


Sign In
Create Account


Back to top










