UW CSE logo uw

CSE 142: Computer Programming I, Winter 2008

arrow CSE Home arrow About Us arrow Search arrow Contact Info

Homework 7 (Personality Test) FAQ

Where do I start?????
How do I look at the letters of the String to see whether they are A or B?
How do I count the A or B into the right element of the array?
How do I output to a file? How does PrintStream work?

Q: Where do I start?????
A: Try to break the problem into pieces. First try to read a record (name and 70 answers) from the file. Then try to count the A's and B's. Look at the pretty diagram on the back of the handout for inspiration.
Q: How do I look at the letters of the String to see whether they are A or B?
A: Look at section 4.4 in the text book and look over section problems. The String class's charAt() method might be useful...
Q: How do I count the A or B into the right element of the array?
A: Is there a repeating pattern? Look at the lecture example on section attendance.
Q: How do I output to a file? How does PrintStream work?
A: A PrintStream works just like System.out. Look in Chapter 6 section 6.4, or the slides, or the lecture example Sections2.java.