/* (Generate vehicle plate numbers) Assume a vehicle plate number consists of three uppercase letters followed by four digits. Write a program to generate a plate number. */ public class Exercise_04_25 { public static void main(String[] args) { // Generate three random uppercase letters int letter1 = 65 + (int)(Math.random() * (90 - 65)); int letter2 65 + (int)(Math.random() * (90 - 65)); int letter3 = 65 + (int)(Math.random() * (90 - 65)); // Generate four random digits int number1 = (int)(Math.random() 10); int number2 = (int)(Math.random() * 10); int number3 = (int)(Math.random() * 10); %3D int number4 = (int)(Math.random() * 10); // Display number plate System.out.println("" + (char)(letter1) + ((char)(letter2)) + ((char)(letter3)) + number1 + number2 + number3 + number4); } }
/* (Generate vehicle plate numbers) Assume a vehicle plate number consists of three uppercase letters followed by four digits. Write a program to generate a plate number. */ public class Exercise_04_25 { public static void main(String[] args) { // Generate three random uppercase letters int letter1 = 65 + (int)(Math.random() * (90 - 65)); int letter2 65 + (int)(Math.random() * (90 - 65)); int letter3 = 65 + (int)(Math.random() * (90 - 65)); // Generate four random digits int number1 = (int)(Math.random() 10); int number2 = (int)(Math.random() * 10); int number3 = (int)(Math.random() * 10); %3D int number4 = (int)(Math.random() * 10); // Display number plate System.out.println("" + (char)(letter1) + ((char)(letter2)) + ((char)(letter3)) + number1 + number2 + number3 + number4); } }
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
Related questions
Question
What happen on line 9,14,21 and 22?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT