Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2: Driver's License number generator (8 Marks) Name your program as LastName_FirstName_A2Q2.java License number is a unique number assigned to each Driver's license.


image text in transcribed

Question 2: Driver's License number generator (8 Marks) Name your program as LastName_FirstName_A2Q2.java License number is a unique number assigned to each Driver's license. Every country has a different process on creating one. Manitoba has a pretty unique way of generating a license number. This is partially based on your first name, last name and some random numbers that are generated to make it unique for each individual. For example, for name Stew Dent, license number can be D-E-N-T-S-*878TW. The purpose of this question is to replicate that process to a certain extent. It will use the first and last name of the users however will only use length of last name instead of last set of random numbers. For example, for name Stew Dent, license number should be D-E-N-T-S-*4. Where D-E-N-T is student's last name, S is the first letter of his first name and 4 is the length of his first name. To achieve that, program will scan through the last name and is required to insert hyphen (-). Write a Java program to ask user for its first and last name. It then does processing with that information to generate a unique license number. . Following information will be asked from the user: . First name: This will be entered as a String type. Last name: This will be entered as a String type. Following processing will be done with the information. 0 Scan the last name and print each letter with a - between them. After scanning the last name, first letter of first name is added. 0 Once the first letter is printed, License number is generated by scanning through the last name and add-after every character. Once the scan is done for the last name, first letter of the first name is added after a-. 0 In the end, an asterix (*) with the length of first name is added. . Output should look something like this, Enter your First name: Stew Enter your Last name: Dent Your License is: D-e-n-t-8-4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

=+a) Find the EV for his actions.

Answered: 1 week ago

Question

What is managements primary objective?

Answered: 1 week ago

Question

What is a classifi ed balance sheet?

Answered: 1 week ago