Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 java help please
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Honour




PostPosted: Wed Dec 19, 2007 12:48 pm   Post subject: java help please

I need java help please.

SPECIFICATION:
A friend of yours has started a political polling organization. She hopes to sell her services to politicians and would be politicians who want to know what the public is thinking about various issues. One of her method is to have her employees stop people in the street, and ask them three questions, each of which has a Yes or No answer (with provision for answers which are neither Yes or No, marked ?No Response?). The employee fills in a form ? a questionnaire ? for each person questioned. Each questionnaire form is individually (uniquely) numbered.
She needs you to write a program which can tabulate and present the results of the polling process, as recorded by the forms filled in by her employees at each interview with a member of the public.
The form filled in by the employee consists of the following:
QUESTIONAIRE NUMBER:
AGE: [ ] SEX: M [ ] F [ ]
POSTAL CODE OF RESIDENCE: [ ]
QUESTION 1: YES [ ] NO [ ] NO RESPONSE [ ]
QUESTION 2: YES [ ] NO [ ] NO RESPONSE [ ]
QUESTION 3: YES [ ] NO [ ] NO RESPONSE [ ]

ASSIGNMENT:
Write a program in java which can do the following:
A data entry operator will have a stack of filled-in forms, and will use your program to generate statistics from them. When the operator runs the program, it should allow the data from each form to be entered. This data does NOT have to be stored: rather, when the operator has finished entering the data, the program should print out a summary of the data entered, like this:
Male: 231 Female: 265 Total: 496
Age: <=25: 187 26 ? 45: 161 >=46: 148 Total: 496
Question 1 : Yes : 391 No : 85 No Response : 20
Question 2: Yes : 117 No : 328 No Response : 51
Question 3: Yes : 204 No : 253 No Response : 39

Note that we do not store data about each possible age: for example, an age of 22, or 17, is stored by simply increasing the total of ages under or equal to 25. Note that the Post code data is not entered. You will need to think about how to ?code? the data for entry. You do not want to make the operator type in Y,E,S, for a question. Rather, you need to allow the operator to enter a one keystroke code for YES, or No, or NO RESPONSE. (For instance: YES could be 1, NO could be 0, and NO RESPONSE could be 2.)
NOTES ON PROGRAMMING
(1) As with all serious programming, build your program up a step at a time, compiling and testing as you go. With this program, a sensible process would be: get a program that can read in all the data successfully. When that is working, add a section for using each data item that has been entered to update the variable in which you are storing the summary statistics for that item. If you work this way, then, at each step, if something goes wrong, you?ll have a good idea where to look for the problem.

(2) A one or two page description of how you tested the program to make sure that it worked. This should include a table showing various combinations of inputs with expected, and actual, outputs, plus a brief discussion of why you chose the particular values in the table.(HINT: make sure your program works with various combinations of extreme values. For example, it should give a correct output when: just one set of data is entered; when all respondents are female; when all answers to Question 1 are ?No Response?; and so on. You should test your program with about ten different combinations of values. )

(3) A one to two page description of how your program works. Make reference to the different variables and control structures (IF ELSE, FOR, etc) you used. You may wish to number the different sections of program (using the commenting delimiters) and refer to ?Section 1? and so on.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: