Wednesday, October 24, 2007

How did you go about testing your program? What were the results of that testing?

Today I worked on writing a code that would give a numeric grade for a letter grade given by the user. I needed to use the String method for this as I ask the user to give me a letter grade. When the user gives the letter "A" for instance, the program is to respond as "4.0." I need to use the String method to store the A value. But the problem comes when the user inserts either an "A+" or an "A-". My program is to recognize when there is a + or - next to the letter and add or subtract .3 from the normal value. When checking for that, I primarily used something like this:
String a == String ToBeChecked;
This does not work with strings as they are not primitives. So there was an error on my program. It should be fixed like this:
String a = equals(ToBeChecked);


No comments: