这么个问题..要写成JAVA 程序....不太会..请高手指教Problem Description:
When students enrol at universities such as La Trobe they are allocated a username to access their
university computer accounts. This assignment requires you to write a program to generate unique
usernames for all the students enrolling in a given year. The program will output to a new file a list
of users along with their generated usernames and passwords.
Page 2 of 5
Usernames are a combination of the student’s initials and their family name. For example, Fred
Nerk’s username would be generated as fnerk. If there is more than one student with the same
family name and initials, a number would be inserted between the initials and the family name in
the username. For example, if we had both Jane Doe and John Doe in the enrolment list, the one
whose given name comes first (alphabetically), Jane Doe, would be allocated the username j1doe
while John Doe would be allocated the username j2doe. Usernames are specified all in lower case
and if a student has a family name consisting of more than one word, all of the words should appear
in the username, but there should be no spaces. For example John Di Clemente’s username could
be jdiclemente. Students with more than one given name have the initials of each given name
included in their username. For example Anne Marie Smith’s username could be amsmith (or
am1smith etc).
The program must also allocate to each user an initial password. This password consists of the first
3 letters of their birth month (with the first letter only in uppercase), the day of the month on which
they were born and the last 4 digits of their student number. For example, if a student’s birthday
was 05 November 1922 and their student number is 41023948, the program must allocate them the
password Nov053948.
The enrolment file that you receive will be sorted by student number. To ensure you check that
each username created is unique, you will need to utilise searching and sorting techniques. The
output file must be ordered by family name and then by given name.
Assignment Requirements
Write a Java (or C++) program called CreateUserAccounts that reads in a file of enrolled
students, stored in text format (6 lines per entry). The program must then generate usernames and
passwords for all the students and create a new file with this information. The program will take 2
command-line arguments. The first parameter is the name of the student list to read in, the second
parameter is the name of the file to which the user account list will be written.
Each enrolled student in the enrolment file is represented as follows:
Student number (An eight digit number)
Family name, Given names (A comma separates the two fields)
Street Address
Suburb State Postcode (The postcode is the last number on this line)
Day Month Year (The fields of their birthday)
(Blank line after each entry)
The account information output to the new file must have the following form with one blank line
between each record:
Family Name: <Family name>
Given names: <Given names>
Student number: <Student number>
Username: <username>
Password: <password>The program will be run with one of the following commands (we will batch run all submissions):
> java CreateUserAccounts studentList accountInformation