Programming Forums
User Name Password Register
 

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

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

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


Samle Input and Output:

Enter 4 digit voter number: 1234

Enter Voter Type (Republican = 1, Democrat = 2, Independant = 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.

All that I need right now is the psuedocode for this. I need the program code next week.

Any help will be greatly apperciated.
terarenee2003 is offline   Reply With Quote
Old Feb 11th, 2005, 1:19 PM   #2
EdSalamander
Programmer
 
EdSalamander's Avatar
 
Join Date: Dec 2004
Location: Tucson, AZ, USA
Posts: 80
Rep Power: 4 EdSalamander is on a distinguished road
Send a message via AIM to EdSalamander
Tell you what. Give it a try, than ask if you're on the right track. We tend to prefer the shot-first-and-ask-questions-later approach 'round here.
__________________
I can pick my friends. And I can pick my nose. So, why can't I pick my friend's nose?
EdSalamander is offline   Reply With Quote
Old Feb 11th, 2005, 1:57 PM   #3
terarenee2003
Newbie
 
Join Date: Feb 2005
Posts: 6
Rep Power: 0 terarenee2003 is on a distinguished road
Is this anywhere close at all?

enter voter number
get voter type
get voter age
get gender type
if another voter
enter voter number + 1
get voter type
get voter age
get gender type

I am so confused on this kind of stuff.
terarenee2003 is offline   Reply With Quote
Old Feb 11th, 2005, 2:26 PM   #4
Hockeyman
Programmer
 
Hockeyman's Avatar
 
Join Date: Jan 2005
Location: Vancouver, Canada
Posts: 60
Rep Power: 4 Hockeyman is on a distinguished road
Send a message via MSN to Hockeyman
That's pretty good...add a loop to get more voters, not just request more input...

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
__________________
~ You know, Hobbes, some days even my lucky rocketship underpants don't help. ~

Hockeyman 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:11 AM.

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