Write an application named, Names.java, that presents the user with a menu of tasks and continues reading a user selection and performing tasks until the user enters the selection for terminating the application. This application will do four tasks related to processing the file, names.txt, which gives boys and girls names and their popularity rankings for 11 decades beginning in 1900. In this file, a popularity of zero indicates a ranking that was 1000 or more. Each line of the file contains one name at the beginning followed by 11 integers. The integers are the popularity ranks for the name at the beginning of the line. The first integer is the rank for the decade, 1900-1910; the second integer is the rank for the decade, 1910-1920, etc. This file format can be assumed to hold for every line of the file.
The application must begin by calling a method to read the entire file and load its contents into two parallel arrays, one string array of names and one two-dimensional array of integers. The index for a particular name will also index that name’s popularity rankings in the two-dimensional array of integers.You should read the file a line at a time using a string Scanner on that line to store the name into the string array and the 11 integers into the corresponding row of the two-dimensional array of integers rankings. The file format and the two parallel arrays were discussed in the classroom when these requirements were distributed.Once the file’s data is loaded into the arrays, present to the user the menu of tasks from which to choose: 1 – Have names ordered by increasing in length
In this task, the program will create a new file in the current folder that contains all the same data as
names.txt, but has the names ordered by increasing length: all names of length 1 in alphabetical order, followed by all names of length 2 in alphabetical order, followed all names of length 3, etc. The new file should be named, ByNameLength.txt. This task should also display to the console the number of each name length found as it processes the new file and displays the final count of names and the new file name to the console upon completion. See the example execution log for details on the format of the console display. See Example output file for details on the format of file contents.
2 – Names better than a given name
In this task, the program will create a new file in the current folder that contains all names with a better ranking than the name entered by the user in the decade also entered by the user. This task must prompt the user for that name and the decade of interest. If the name is not found, display an appropriate error message and keep prompting for a name. Rankings are better if the popularity rank for that name in the same decade is less than the rank for the entered name and decade (but NOT equal to zero). Note: that if the entered name has a rank of R for the given decade, then the program may find up to (R-1)*2 names with a better rank. For most ranks in each decade there are two names: one typically male and one typically female. The header line of this file states information about the name and decide entered and the last line summarizes the total names found. Use the exact format shown in the example output files. The new file created by this task must be named, Name Better Than
3 – Top N names for a given decade
In this task, the program will create a new file in the current folder that contains the top N names in a specified decade. The user must be prompted to enter the value for N and the particular decade. The file should contain the names ordered by increasing rank value: the two names with rank 1, then the two names with rank 2, then rank 3, etc. The appropriate header and closing lines should also be written. Use the exact format shown in the example output files. The new file created by this task must beTop_
4 –
In this task, the program will create a new file in the current folder that contains the results of applying criteria you came up with for this option. This option must do some processing on the input data based on at least one input from the user. Be sure to make it clear to the user what the program will do in this task. The Results should be written to a file in the current folder whose name identifies which task created the file.
5 – Exit program
This causes the application to terminate after displaying the total number of files created by the application for the user on this run of the program. (Note: selecting the first choice counts as one file no matter how many times the user selects it during the run.)
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.