File handling operation, JAVA Programming

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.)
Posted Date: 2/16/2013 5:44:04 AM | Location : United States







Related Discussions:- File handling operation, Assignment Help, Ask Question on File handling operation, Get Answer, Expert's Help, File handling operation Discussions

Write discussion on File handling operation
Your posts are moderated
Related Questions
Relation between Stack and Heap Stack and heap are two significant memory areas. Primitives are created on the stack whereas objects are created on heap. This will be further c

What interface must an object implement before it can be written to a stream as an object?      Ans) An object must execute the Serializable or Externalizable interface before i

A framework is made up of the set of classes which permit us to use a library in a best possible way for a particular requirement.

Specifically, you'll create a program that will hold minutes worked and assign a value. Calculate the value into hours and minutes. Display the result as shown in Figure 2. Reme

Describe Inner Classes in java? An inner class is a class whose body is described inside another class, referred to as the top-level class. For instance: public class Queue {

String is immutable in java : you can't change a string object but can replace it by creating a new object instance. Creating a new instance is rather expensive.   //Non ef

write a program that count the number of occurences of string in the n-th padovan string p(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college progr

What are adding methods? A subclass isn't restricted to changing the behavior of its superclass. It can also add fully latest techniques and fields that are not shared along wi

This assignment is a good project for working with 2 dimensional arrays. In this program, you will implement an ascii version of the classic game "Connect 4". Connect 4 is a 2 p

Point-to-Point : gives a traditional queue based mechanism where the client application forwards a message through a queue to typically one receiving client that accepts messages