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

Padovan series, write a program in java using array and scanner class to ge...

write a program in java using array and scanner class to generate padovan series

What is the use of lookupdispatchaction, LookupDispatchAction is useful if ...

LookupDispatchAction is useful if the method name in the Action is not driven by its name in the front end, but by the Locale independent key into the resource bundle. As the key i

Program on object oriented technology, This assignment is intended to write...

This assignment is intended to write a simple program in Java and to use the concept of Object Oriented Technology. Open a project named "MyProject" in NetBean. Under this proje

Explain difference between method overriding and overloading, What is the d...

What is the difference between method overriding and overloading? Overriding is a method with the same name and arguments as in a parent, whereas overloading is the same met

What is a local member and a class variable, What is a local, member and a ...

What is a local, member and a class variable? Variables declared within a method are "local" variables. Variables declared within the class i.e not within any methods are "m

Relational mapping integration module, What are object/relational mapping i...

What are object/relational mapping integration module? Ans) Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by giving the ORM module

What is an applets, What is an Applets? Applets: These are small java...

What is an Applets? Applets: These are small java programs. They can send from one to another computer over internet by using Applet Viewer which supports java. Applets

Bluej, how to write a program to assign value of variable age and print if ...

how to write a program to assign value of variable age and print if person is major.

What is final class, What is final class? A final class can't be extend...

What is final class? A final class can't be extended ie., final class might not be subclassed. A final method can't be overridden when its class is inherited. You can't alter v

What is meant through semantic error, What is meant through semantic error?...

What is meant through semantic error? It is an error that a developer encounters while a statement is executed but it was not intended through him (the developer). Such errors ar

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