Write a Java program that will generate random four letter words. The words must consist of only lower case letters. The program will prompt the user to enter the number of words to generate. The program should request that the user enter a number between 1 and 500 and ensure that they comply. It will then generate the appropriate number of words neatly displaying them separated by spaces 10 words to a line. After the words are displayed the program must display the first word and also the last word if they were sorted alphabetically.
PLz help i m trying it but couldnt make it rite.plz urgent help.thnx in advance.
public class randon11 {
public static void main(String[] args){
double i;
int nbrwords,hold, count=0;
char word;
String word1,word2;
TextIO.put("Enter the Number of words to generate :");
nbrwords=TextIO.getlnInt();
// while(count !=nbrwords){
for(int j=1;j<=4;j++){
i=5*Math.random()+(int)'a';
//hold=(int)i;
word=(char)i;
//word1=(cha)