Topic 1 - Variables and Data Types
Topic 2 - Conditionals and Strings
Topic 3 - Loops
Topic 4 - Arrays
Topic 5 - File Handling
Semester 1 Projects
Topic 6 - Classes/Objects and Methods
Topic 7 - ArrayLists
Semester Projects

Part 1c: Counts of A/B

To count the number of A and B answers for each dimension, you need to know something about the structure of the test.  You will get the best results if you take the test without knowing about the structure, so you might want to take the test first before you read what follows.  

The test has 10 groups of 7 questions with a repeating pattern in each group.  The first question in each group is an Extrovert/Introvert question (questions 1, 8, 15, 22, etc).  The next two questions are for Sensing/iNtuition (questions 2, 3, 9, 10, 16, 17, 23, 24, etc).  The next two questions are for Thinking/Feeling (questions 4, 5, 11, 12, 18, 19, 25, 26, etc).  And the final two questions in each group are for Judging/Perceiving (questions 6, 7, 13, 14, 20, 21, 27, 28, etc).  Notice that there are half as many Extrovert/Introvert questions as there are for the other three dimensions.  The seventy letters in the input file appear in question order (first letter for question 1, second letter for question 2, third letter for question 3, etc).

Remember that the user might leave a question blank, in which case you will find a dash in the input file for that question.  Dash answers are not included in computing the percentages.  For example, if for one of the dimensions you have 6 A answers, 9 B answers, and 5 dashes, you would compute the percentage of B answers as 9 of 15, or 60%.

This means that you will need to get each of the letters in a line of answers. So if the input is :

BA-ABABBB-bbbaababaaaabbaaabbaaabbabABBAAABABBAAABABAAAABBABAAABBABAAB

You will need to break that up and read each character. Notice that you can have lowercase and uppercase letters!

Think about how you get each letter and where you’ll store the count for each one? What have we learned in class that does something similar?