Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 16th, 2005, 7:28 PM   #1
terarenee2003
Newbie
 
Join Date: Feb 2005
Posts: 6
Rep Power: 0 terarenee2003 is on a distinguished road
Post Project Help!

This program will allow a user to enter Voter information, which will be formatted and tabulated into a final report.

Sample Input and Output:

Enter 4 digit voter number: 1234

Enter Voter Type (Republican = 1, Democrat = 2, Independent = 3): 1

Enter Gender Type (Female = 1, Male = 2): 1

Enter Voter Age: 30

//Then echo data back to user

Voter#1: //the number should go up each time

Voter Number: 1234 Voter Type: 1 Gender Type: 1 Voter Age: 30

Enter another Voter (Y/N): Y //if yes is entered, go back and get another voter

Once N is entered the following report will be printed:

Vote 2000 Statistics

Voters entered in to the system X
Average Voter Age XX


Two methods and one class should be used. Have a method called GetAVoter that collects and echos the data from the user and one called PrintVoterReport that prints the report. You will need to determine how and where to do the counts and totals. Remember that the variable can only hold one value at a time.


Here is the psuedo code that i got.....

1. START LOOP

2. WRITE: Enter voter number (assuming the voter number is something the user enters, not auto-generated by the program)

3. READ: voterNumber

4. WRITE: Enter voter age

5. READ: voterAge

6. WRITE: Enter voter type

7. READ: voterType

8. WRITE: Enter another voter?

9. IF YES: loop to line 1

10. ELSE: exit loop

11. PRINT: results


I am needing help on how to start writting the program.

Any help would be greatly apperciated.
terarenee2003 is offline   Reply With Quote
Old Feb 16th, 2005, 8:13 PM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
Here's what ya do.
1) Push your keyboard aside
2) grab a piece of paper and a pen
3) Write in plain english the steps you have to take to write this program
4) Write the same thing in pseudocode using english, but the code structures you need
5) Look it over, make sure it all makes sence
6) Code the program.
7) Test it for bugs
8) Check with us if you have some code, and have attempted to try to get it done
we're not a homework service, sorry, i don't have time to write a program for everybody who comes on this forum, I do have time however to help people with problems like,
for(int i = 0; i < -1; i++) { blabla };
why doesn't this work?
Give it a try, come here with specific problems.
good luck, please don't take my rant personally, it goes for everybody who expects us to be able to write something like this in 10 minutes.

Dizz
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Feb 17th, 2005, 12:06 PM   #3
terarenee2003
Newbie
 
Join Date: Feb 2005
Posts: 6
Rep Power: 0 terarenee2003 is on a distinguished road
Post Is this anywhere on the right line??

// The "Voter" class.
public class Voter
{
String VoterNumber // Voter Number

String VoterAge // Voter Age

String VoterType // Voter Type

public void GetAVoter() throws IOException
{
BufferedReader inData; //Input stream for strings

inData = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter voter number: ");
VoterNumber = inData.readline();
System.out.println("Enter voter age: ");
VoterAge = inData.readline();
System.out.println("Enter voter type: ");

}

public static void main (String[] args)
{
GetAVoter
read = new Voter();
read.VoterNumber();
read.VoterAge();
read.VoterType();
{
// Place your code here
} // main method
} // Voter class


I am so lost!
terarenee2003 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC