answersLogoWhite

0


Best Answer

Now I haven't done Java in years, but I did a little research and things have changed a bit, but this should work:

import java.util.Random;

Random rand = new Random();

String newNum = "";

for (int i = 0; i < 3; ++i) {

int randNum = rand.nextInt(26)+65;

newNum = newNum + ((char)randNum);

}

for (int i = 0; i < 3; ++i) {

int randDigit = rand.nextInt(10);

newNum = newNum + randDigit;

}

System.out.println("Three Letters, and 3 Numbers: " + newNum + ".");

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a JAVA program to generate random 3 random upper case letter follow by 3 random numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Enter a alphabet and cheak weater it is a vowel or not in java a program?

import java.util.Scanner; public class main(){ public static void main(String[]args){ Scanner er=new Scanner(System.in); char letter = " "; System.out.print("enter a letter"); letter = er.nextChar(); if (letter =='a' letter =='A' letter =='e' letter =='E' letter =='i' letter =='I' letter =='o' letter =='O' letter =='u' letter =='U'){ System.out.print("its a vowel"); } else { System.out.print("not a vowel"); } } }


Write a program to generate a random sequence of capital letters that does not include vowels in java?

public class Capitals { public static void main(String args[]) { int counter = 0; // Counter for number of capitals generated. int numberToGenerate = 20; // Number of capitals to generate. char symbol = 0; // Variable to store a random character. // While there are still letters to generate: while( counter &lt; numberToGenerate ) { // Generate a random symbol between A and Z: // This relies on the fact that the codes for the letters are in a // contiguous sequence from 'A' to 'Z'. If we add 1 to 'A' we get the // code for 'B', if we add 2 we get 'C', and so on. Thus to create a // random capital letter from 'A' to 'Z' we can add a random integer // between 0 and 25 to 'A'. symbol = (char)(26*Math.random() + 'A'); switch(symbol) { //Vowels ignored: case 'A': case 'E': case 'I': case 'O': case 'U': break; default: //Consonant displayed: System.out.print(symbol + " "); counter++; break; } } } } by:- Munawar Ali bhurgri from Badin 0300-2490262


WAP in java to take alphabet and print ascii value for it?

Remember that chars in Java are just a special version of ints. Cast the char as an int and you get the Unicode value for it. Fortunately, the group of characters including letters and numbers have the same value in both encoding systems. for (char letter = 'a'; letter &lt;= 'z'; ++letter) { System.out.println("ASCII of " + letter + " = " + (int) letter); }


Explain the term identifier in java?

Identifiers are the strings you use in Java source code to identify unique things, such as variables, classes, and methods. Identifiers may be any word beginning with a letter or underscore, and continuing with letters, numbers, and underscores. Identifiers are case sensitive.

Related questions

What does every number and letter mean in a motorcycle VIN number mean?

They have no specific meaning. The order of letters and numbers are used to generate the largest number of possible combinations.


What is a seven letter word for Generate?

produce


What is follow up letter?

A follow up letter is a letter written to determine the status of a previous letter. A follow up letter might be written to inquire about a resume sent to a particular company.


What is the purpose of follow-up letter?

Your purpose is to show your appreciation for the interview and to restate your interest in your job.


How do you type the letter e in numbers?

Letter e with numbers denotes exponential figure.


What does pp mean in a letter?

&quot;PP&quot; in a letter stands for &quot;per procurationem,&quot; which is a Latin phrase meaning &quot;through the agency of.&quot; It is used when someone signs a letter on behalf of someone else.


How to write a support letter for a youth program?

How do you write a support letter for a youth program that is on the brink of shutting down?'


What is the difference between Pseudo-code and an actual computer software program?

the difference between that two words is the spelling, numbers of letters and the first letter in that two particular words


How to write a letter to a friend asking him about summer vacations outing program?

Writing a letter to a friend asking him about a summer vacations outing program is simple. Ask him when and where the program will be.


How do you break down a model 1897 pump shot gun?

You must use an ASSEMBLY INSTRUCTION SHEET WITH PART NUMBERS AND DIAGRAMS and follow it to the letter. I have them for $5.55. Don guncolletor@att.net


What is the opposite of follow that starts with a p?

Precede is the opposite of follow. It begins with the letter p.


What are letter generators used for?

Letter generators are tools that are designed for students and help them to learn to identify the parts of a business that are essential and then generate letters by typing into letter templates.