Sunday, November 25, 2007

Scored thru 11/25 (20 pts possible) - see Edline for your score tomorrow evening.

Thursday, November 15, 2007

What choices did you face in developing your solution, and how did you choose among them?
Like I have mentioned once before, which loop a programmer chooses is really critical. When I was making a Game today, I needed to use a loop in my program. I chose the while loop because the do while loop and the for loop were not really apropos for the program. I used a boolean to start up and I used the value of the boolean to state the control expression of the while loops. My loops were also nested, as that would take much lees coding than using loops that are not nested. Choosing nested while loops helped me keep my program limited and easily understandable.

Wednesday, November 14, 2007

Provide yourself an example (not one from your instructor) of how you use a particular command that will help jog your memory in the future when you need that command again. You must provide a little code as well as a written explanation with this one.

A class called Random Generator helps programmers use random numbers and simulations in their programs. If you wanted to make a die that makes any number between 1 to 6 randomly, this class would be of great help. Look at the following example:
import java.util.Random;
public class Dies { public Dies (int s)

{
sides = s; generator = new Random();
}
public int cast()
{
return 1 + generator.nextInt(sides);
}
private Random generator;
private int sides; //private int sides2;
}

It a testing class was made, it would provide any random number between 1 and 6 just like a die would. Thus, the Random class is very important. (I am going to use it in the GameLand project.)

Tuesday, November 13, 2007

What problems did you encounter while developing your solution? How do you plan to overcome them?/How did you overcome them?

While doing an assignment, I encountered a problem in which I thought everything was fine but the compiler kept on giving me unexpected answers. It is a program that asks the user for grades and calculates their GPA. The compiler kept on giving the wrong calculations although the code seems to be fine. I have not overcome the problem yet, but next class, I plan to scan the whole code and find the bug. It is probably an int / double problem.

Monday, November 12, 2007

What progress did you make today on your solution? What needs to be completed next class?
Today in class, I worked more on assignments dealing with loops, mostly nested loops. Working on these assignments helps me better understand how and when iterations are used. I used the apcslib library and nested loops to make very interesting pictures. By workings on these projects, I am able to extend my understanding of loops and how I might use them in real life. Next class I plan to work on more projects so that I will be even better when using loops.

Friday, November 9, 2007

How did you go about testing your program? What were the results of that testing?
Today, I made a program that draws a circle that has 360 radii of different colors. When I first made the program, I found out that it did not draw all 360 radii as I intended it to. That was because I did not reset the direction back to 0. Once I did that, I saw a picture that has 360 radii perfectly aligned. To make them of different colors, I made the DrawingTool generate random colors by using the Math.random() method. Finally, the program turned out to be a very interesting an good looking one.

Thursday, November 8, 2007

Are there any specific tips you would give to someone else tackling the same problem? How would what you suggest benefit that person in solving the problem?
The loop type a programmer uses really matters according to what program he / she is writing. If two loops have to be nested, the best loop type that can probably be used is the for loop. The while and do-while loops are not very suited for nesting. Whenever a programmer needs to nest loops, the best one to use is the for loop.

Wednesday, November 7, 2007

What choices did you face in developing your solution, and how did you choose among them?

When considering loops and iterations, one could use either the for loop, or the while loop, or the do-while loop. It is critical which one a programmer used in his / her program. A for loop would be used when the programmer wants to initialize a variable in the loop it self. A while loop is essentially similar to the for loop but, in a while loop, the initialization is done outside. The minimum number of times a while loop can run is 0 times. The do-while loop, however, runs at least once. The difference between a while loop and a do-while loop is when the condition expressions are considered. In a while loop, the conditions are tested before the statements are compiled, but in a do-while loop the statements are run once before the conditions are tested. Thus, a programmer should chose one of these three types of iterations wisely so that it would best fit his / her program.

Tuesday, November 6, 2007

What progress did you make today on your solution? What needs to be completed next class?

Today, I worked more on loops; for loops to be specific. I did exercise questions on for loops to help me better understand the importance of the loop and how it is used. I also learned about a do while loop and how it is different from a while loop. I now know all three types of loops and I know what the difference between the three types, but I still need to exercise so that I can master each type. Next class, I plan to practice more and master iterations.

Friday, November 2, 2007

Iterations

Iterations are repetitions. They can be used for several purposes in people's daily lives. One purpose of iterations is saving money. If a person wants to save money, but also wants to buy lots of clothes, he might want to create a program which would tell him if he could spend money or not. He would set a sentinel value of the maximum money he can spend on clothes and the program would tell him if he is spending too much money. Iterations can also be used to verify what a numbers first digit is.

Thursday, November 1, 2007

Scored through 10/31. All blogs from this point forward are second marking period.
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************