Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

i want program for the below problem,help me

 
asha paruchuri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Scenario
In preparation for the 2004 Presidential election, the company you work for, Good Programming, Inc (GPI), has been asked to design a centralized system for recording and tallying votes. GPI has plans for users to be able to connect to the voting system via the Internet, validate their identity, and cast their votes on local or national issues. As a recently hired programmer, you have been assigned to write a program that can be used to detect voting fraud.

Assignment
Your program will read three files. The file named voter.dat contains information about voters, one voter per record. The file named votes.dat contains information about how voters voted on different issues, one record per vote. The file named deaths.dat contains information about voters who have died, one record per voter who has died. See below for the file format for each file.
Your program must process each voter in the voter.dat file. Processing a voter means checking for possible voting fraud. Voting fraud is defined as any of the following cases:
A voter has voting records dated after that person died.
A voter has multiple voting records for the same issue.
Votes exist from a voter who doesn't exist.
If your program finds a case of possible voting fraud, you must output a message to the file named fraud.dat with enough information for an investigator to look into the possible fraud.
You may assume that each file is in the correct format. However, there are various logical errors that you must identify and test against. For example, one logical error would be if the program was run and the voters.dat file did not exist. Your test plan must cover all the logical errors.
Since there will be a large number of people voting in the next presidential election, your manager is concerned about the efficiency of your program. To be as efficient as possible, your program should read each record from the data files only once.

voter.dat file format
The voter.dat file contains information about the voters, one voter per line. The lines in the file are in ascending order by voter id.
id:name:address
id - This is a voter id, a number greater than 0.
name - This is the full name of the voter.
address - This is the voter's address.

votes.dat file format
The votes.dat file contains information about the votes, one vote per line. The lines in the file are in ascending order by voter id. There may be more than one vote per voter id. For a single voter, the lines are in ascending order by issue number.
id:issue ate:vote
id - This is a voter id. This id may or may not be in the voter.dat file.
issue - This is the number of the issue being voted on. It is a positive number.
date - This is the date of the vote, in MM/DD/YYYY format.
vote - This is the vote cast for this issue. It may be one of the following: Y (a value of Y indicates a vote for the issue) or N (a value of N indicates a vote against the issue).

deaths.dat format
The deaths.dat file contains information about voters who have died, one voter per line. The lines in the file are in ascending order by voter id.
id ate:cause
id - This is a voter id. This id may or may not be in the voter.dat file.
date - This is the date of the voter's death, in MMDDYYYY format.
cause - This is a description of how the voter died.

Example data files:
voter.dat
1:Jay Shaffstall:999 Franklin St, Columbus, OH 43221
2:Lisa Olinger:888 Sunny Vale, Columbus, OH 43221
3 octor Smith:333 Lost St, Columbus, OH 43221
votes.dat
2:1:11/08/2000:Y
2:2:11/08/2000:Y
2:2:11/08/2000:N
3:3:11/08/2000:Y
4:5:11/08/2000:Y
deaths.dat
3:05281999:Natural causes
fraud.dat
Voter ID: 2 Name: Lisa Olinger
extra vote on issue 2
Voter ID: 3 Name: Doctor Smith
voted on issue 3 after dying on 05/28/1999 of natural causes
Voter ID: 4 does not exist in voter file
voted on issue 1
An
 
Joe Ess
Bartender
Posts: 9339
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Do your own homework. One learns to write software by writing LOTS of software. If you have any specific questions about Java syntax or have some specific problem, the community here is glad to help.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
please don't post the same thread in multiple forums. It makes the conversation difficult to follow, and wastes people's time when the question has already been answered in another forum.
Please follow the original conversation here
 
    Bookmark Topic Watch Topic
  • New Topic