Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

PersonalityTest Java Assignment

Gauntlet
Gauntlet 


Write a program (PersonalityTest.java) to score users’ responses to the classic Myers-Briggs personality test. Assume that the test has 70 questions that determine a person’s personality in four dimensions. Each question has two answer choices that we’ll call the “A” and “B” answers. Questions are organized into 10 groups of seven questions, with the following repeating pattern in each group: • The first question in each group (questions 1, 8, 15, ... 64) tells whether the person is Extrovert or Introvert. • The next two questions (questions 2 and 3, 9 and 10, 16 and 17, ..., 65 and 66) test whether the person is guided by his/her Sense or iNtuition. • The next two questions (questions 4 and 5, 11 and 12, 18 and 19, ..., 67 and 68) test whether the person focuses on Thinking or Feeling. • The final two questions in each group (questions 6 and 7, 13 and 14, 20 and 21, ... 69 and 70) test whether the person prefers to Judge or be guided by Perception. In other words, if we consider extrovert/introvert (E/I) to be dimension 1, sensing/intuition (S/N) to be dimension 2, thinking/feeling (T/F) to be dimension 3, and judging/perception (J/P) to be dimension 4, the map of questions to their respective dimensions would look like this: 12233441223344122334412233441223344122334412233441223344122334412 23344 BABAAAABAAAAAAABAAAABBAAAAAABAAAABABAABAAABABABAABAAAAAABAAAAAABA AAAAA The following is a sample input file of names and responses: Betty Boop BABAAAABAAAAAAABAAAABBAAAAAABAAAABABAABAAABABABAABAAAAAABAAAAAABA AAAAA Bugs Bunny aabaabbabbbaaaabaaaabaaaaababbbaabaaaabaabbbbabaaaabaabaaaaaabbaa aaabb Han Solo BA-ABABBB- bbbaababaaaabbaaabbaaabbabABBAAABABBAAABABAAAABBABAAABBABAAB The input file contains a name followed by his/her responses to the test. The answer to a question is case insensitive, and can be A, B, or – where a dash represents that the person skipped that question. If less than 50% of a person’s responses are B for a given personality dimension, the person’s type for that dimension should be the first of its two choices. If the person answers B more than 50%, the person’s type for that dimension is the second choice. If the person has the same number of As and Bs for a dimension, give them an “X” (as with Han Solo). Ask the user to enter the input filename and check if the file exists. If yes, process the file. Otherwise, ask the user again to enter the input filename until a correct name is entered. You may assume that the input file contains no errors and that nobody has skipped all questions for a dimension. Given the above input file, the resulting output would be: Betty Boop 1A-9B 17A-3B 18A-2B 18A-2B [90%, 15%, 10%, 10%] = ISTJ Bugs Bunny 8A-2B 11A-9B 17A-3B 9A-11B [20%, 45%, 15%, 55%] = ESTP Han Solo 2A-8B 9A-9B 11A-9B 15A-5B [80%, 50%, 45%, 25%] = IXTJ Attachments Tags Clarifications

Answers

JAVA Personality Test Solution

Seeker
Seeker 



JAVA source code in attached file.

Hashtables used.
Attachments
PersonalityTest.java (7 K) Download Preview
if(judgeAvg < 50){ jp = "J"; }else if(judgeAvg > 50){ jp = "P"; }else{ jp = "X"; } // printf syntax to get ints is %d, strings is %s System.out.printf("%dA-%dB\t%dA-%dB\t%dA-%dB\t%dA-%dB", introvertAs, introvertBs, senseAs, senseBs, thinkAs, thinkBs, judgeAs, judgeBs); System.out.printf("\n[%s,\t%s,\t%s,\t%s] =

Results.txt (1 K) Download Preview
Betty Boop

Preview.jpg (36 K) Download Preview

Screenshots
Screenshot
Purchase Answer

JAVA Personality Test Solution

Seeker
Seeker 



Source code attached.

Simple arrays and constructs used.
Attachments
PersonalityTest.java (7 K) Download Preview
if(thinkAvg < 50){ tf = "T"; }else if(thinkAvg > 50){ tf = "F"; }else{ tf = "X"; } int judgeAs = judgePerceptionCount[i][0]; int judgeBs = judgePerceptionCount[i][1]; // Cast right side to double so java will divide ints double

Results.txt (1 K) Download Preview
Bugs Bunny

Preview.jpg (46 K) Download Preview

Screenshots
Screenshot
Purchase Answer