Write an application that present user with a menu of tasks

Assignment Help JAVA Programming
Reference no: EM131486433

Assignment

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<name>ForDecade_<D>.txt, where <name> is the name entered by the user and<D> is the decade chosen by the user for this task.

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_<N>_Names_Decade_<D>.txt, where <N> is the number of names entered by the user and <D> is the decade selected by the user. Note: as previously mentioned, because there are two names for most ranks, finding the top N names will usually find N*2 names.

4 - <programmer's criteria>

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.

Attachment:- Names.rar

Reference no: EM131486433

Questions Cloud

Describe use case dependency for making an account transfer : Describe (in a one to two page narrative) a use case dependency for making an account transfer. Illustrate this use case with Visio or a similar product.
Economic struggles during the industrial period : In what ways did Carbon energy play a vital role in shaping up political and economic struggles during the industrial period?
Monopsony marginal expenditure : 1) What is the monopsony's marginal expenditure (ME) curve? 2) What is the monopsony's marginal value (MV) curve?
Analyze any recent public relations campaign : Select TWO public service announcements from the Ad Council and make an argument for or against their effectiveness. What issue would you create a psa for?
Write an application that present user with a menu of tasks : Write an application named, Names.java, that presents the user with a menu of tasks and continues reading a user selection and performing tasks.
What do you think has gone wrong in its fresh-easy strategy : Tesco is a British multinational grocery and general merchandise retailer headquartered in Cheshunt, What do you think has gone wrong in its Fresh-Easy strategy
Differentiate a general obligation bond and a revenue bond : What is the difference between a Treasury bill, a Treasury note, a Treasury bond, and TIPS?
What do you find personally satisfying or dissatisfying : What do you find personally satisfying or dissatisfying at work or school?Have you created a safe environment for those under your leadership?
Calculate the annual interest : Calculate the annual interest and the semiannual interest payment for corporate bond issues with a face value of $1,000.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd