File handling operation, JAVA Programming

Assignment Help:

Write a program called Drivers that displays information about Formula 1 drivers and their teams.  
 
The program starts by prompting (asking) the user for the name of an input text file. This file is guaranteed to be correct and has the following format
 
11
Paul di Resta
Force India-Mercedes
Great Britain
 
The above 4 lines make up what is known as a record. This means that if there is an integer, then the other 3 lines of the record are also present.
 
Explanation of the record

1335_File handling operation.png

There may be any number of records in the input text file. There are NO blank lines between records and no blank line at the end of the file.

The program presents the user with a menu, as follows:
 
F1 Info Menu

1. Display all information

2. Display from country

3. Display from team

4. Display from number

5. Exit

Enter choice >>

  • If the user picks menu choice 1, the entire contents of the file are displayed to the screen.
  • If the user picks menu choice 2, the program prompts (asks) the user for the name of a country. All the drivers in the input text file that match the user input country name have all their information displayed to the screen. 

This search must be case insensitive. That is, upper case and lower case letters should match.

  • If the user picks menu choice 3, the program prompts (asks) the user for the name of a team. All the drivers in the input text file that match the user input team name have all their information displayed to the screen.

This search must be case insensitive. That is, upper case and lower case letters should match.

  • If the user picks menu choice 4, the program prompts (asks) the user for a race number. The driver in the input text file whose race number matches the user input has all their information displayed to the screen.
  • If the user picks menu choice 5, the program exits.
  • Any other menu choice should be displayed as an error, with an appropriate message to the user and the menu is re-displayed. Shown below is a sample run of the program (user input is in bold):(Most of the drivers are not shown for menu choice 1 to save space, your program will show the entire contents of any valid input text file.)

Related Discussions:- File handling operation

Create a simple object based gui application, Objective: create a simple o...

Objective: create a simple object, put that object in a simple collection class, use that object and collection in a simple GUI application. Specification:  Consider a Librar

Create a generic class with a type parameter, 1. The purpose of this proble...

1. The purpose of this problem is to practice using generics.  Create a generic class with a type parameter that simulates drawing an item at random out of a box. For exampl

What can an applet do, What Can an Applet Do? An applet can: • Draw ...

What Can an Applet Do? An applet can: • Draw pictures on a web page • Create a new window and draw in it. • Play sounds. • Receive input from the user by the keyboard or

La food, The fancy new French restaurant La Food is very popular for its au...

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of the

We require responsible and serious programmer, We require responsible and s...

We require responsible and serious programmer Project Description: Big Data and On-line tools Website Liferay - JAVA - Portlets - JSP and JSF Skills required: J2EE,

Illustrate jdbc, JDBC stands for Java Database Connectivity: It is an ...

JDBC stands for Java Database Connectivity: It is an API which gives easy connection to a wide range of databases. To connect to a database we have to load the appropriate dri

Write a xhtml document with java script, Write an XHTML document that uses ...

Write an XHTML document that uses JavaScript code to do the following.  The user is first prompted for a word and then for a possible prefix for that word.  If the prefix is not an

Algorithm, #question)i) devising ii) validating and iii) tes...

#question)i) devising ii) validating and iii) testing of algorithms...

Area under curve., write a program to find the area under the curve y=f(x) ...

write a program to find the area under the curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point,

Data access objects (DOA) in JDBC, Business Objects represent the data cl...

Business Objects represent the data client. They are the objects that need access to the datasource to obtain and store data. Data Access Objects abstract the relying data access i

Write Your Message!

Captcha
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