answersLogoWhite

0

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

15y ago

What else can I help you with?

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); }


How do you write a horoscope program on python?

Hi gys, are you looking to write a program to know the sign depends on the birth date or horoscope on python? write down following codes on python, those will make a nice program. #This program will get the horoscope sign. def getSign(): name = raw_input ("Enter Your Name: ") month = raw_input("Enter Birth Month: ") day = int(raw_input("Enter Birth Day of Month: ")) if month "y": main() letter = raw_input("Go again? (y/n): ")

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.


Can you provide guidance on how to request a strong letter of recommendation for a PhD program?

To request a strong letter of recommendation for a PhD program, choose recommenders who know you well, provide them with your academic achievements and goals, and give them ample time to write the letter. Be polite and grateful in your request, and follow up with a thank-you note after they have submitted the letter.


What numbers end with o?

In English, numbers that end with the letter &quot;o&quot; include zero, one, two, and three. Additionally, larger numbers such as ten, twenty, thirty, and so on also end with &quot;o.&quot; However, most numbers do not follow this pattern.


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.


Can you provide a recommendation letter for a PhD program?

Yes, I can provide a recommendation letter for your PhD program application.


How do you type the letter e in numbers?

Letter e with numbers denotes exponential figure.


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?'


Could you provide me with a letter of recommendation for a PhD program?

Certainly, I am happy to provide you with a letter of recommendation for a PhD program.


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


Can you provide a follow-up recommendation letter for the candidate?

Yes, I can provide a follow-up recommendation letter for the candidate.


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.