Sunday, November 25, 2007
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.
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.)
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.
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.
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.
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.
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.
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.
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.
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************
Wednesday, October 31, 2007
Friday, October 26, 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.
In order to switch two values, there needs to be an additional new variable that is assigned the value of one of the things to be switched up. The following, for example, will not process the right way:
//to switch the two up:
int a = int b;
int b = int a;
// this would give them bot the value of b
To do the right switching up, this has to be done:
int x = int a;
int a = int b;
int b = int x;
// this would work correctly.
It is important to know how this works as such things might be used in many applications. One can use it, for instance, for alphabetizing.
[Ms. Petr, I did this at home because I forgot to do it in class.]
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.
In order to switch two values, there needs to be an additional new variable that is assigned the value of one of the things to be switched up. The following, for example, will not process the right way:
//to switch the two up:
int a = int b;
int b = int a;
// this would give them bot the value of b
To do the right switching up, this has to be done:
int x = int a;
int a = int b;
int b = int x;
// this would work correctly.
It is important to know how this works as such things might be used in many applications. One can use it, for instance, for alphabetizing.
[Ms. Petr, I did this at home because I forgot to do it in class.]
Thursday, October 25, 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?
Comparing Strings, as they are not like primitives, could be perplexing to some people. It is not right to use the <, or >, or any other similar signs when comparing Strings. We rather uses the .compareTo() or the .equals() techniques. These techniques help us compare two strings as follows:
1. the .equals() techniques checks to see if two strings are the same, and
2. the .compareTo() technique gives numeric values (negative, positive, or zero) after checking if two Strings are equal.
When comparing Strings, we use such methods rather than the familiar mathematical signs. I believe these techniques help programmers avoid errors and problems to a certain extent.
Comparing Strings, as they are not like primitives, could be perplexing to some people. It is not right to use the <, or >, or any other similar signs when comparing Strings. We rather uses the .compareTo() or the .equals() techniques. These techniques help us compare two strings as follows:
1. the .equals() techniques checks to see if two strings are the same, and
2. the .compareTo() technique gives numeric values (negative, positive, or zero) after checking if two Strings are equal.
When comparing Strings, we use such methods rather than the familiar mathematical signs. I believe these techniques help programmers avoid errors and problems to a certain extent.
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);
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);
Tuesday, October 23, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today, I worked more on getting information from the user and using the input from the user to get something important done. I imported java.util.* and used the Scanner method to get input. I made a Check Mail Class that checks to see if a package is acceptable. I used if, else if, and else in my class. I also learned that a variable cannot be defined inside an if, else if, or else. Next class I plan to master these methods and getting input from the user.
Today, I worked more on getting information from the user and using the input from the user to get something important done. I imported java.util.* and used the Scanner method to get input. I made a Check Mail Class that checks to see if a package is acceptable. I used if, else if, and else in my class. I also learned that a variable cannot be defined inside an if, else if, or else. Next class I plan to master these methods and getting input from the user.
Thursday, October 18, 2007
What problems did you encounter while developing your solution? How do you plan to overcome them?/How did you overcome them?
Today I developed a Grocery List program that allows people to enter item prices and gives them the final total result. I used the printf method to print the Dollar sign and to limit the number of digits to two. I realized that to assign a value to a double primitive you use f instead of d (when using printf). And to signify integer, you use d. That resulted in an error, but I was able to see in and fix it.
Today I developed a Grocery List program that allows people to enter item prices and gives them the final total result. I used the printf method to print the Dollar sign and to limit the number of digits to two. I realized that to assign a value to a double primitive you use f instead of d (when using printf). And to signify integer, you use d. That resulted in an error, but I was able to see in and fix it.
Tuesday, October 16, 2007
What choices did you face in developing your solution, and how did you choose among them?
Today, I learned howto get input from the user in java. I also learned about the if, else if, and else decision structures. The way we use these structures may affect the way our program is going to turn out. if is used when there is a specification for the result expected. else if is used to do the same thing, but it avoids any specifications made previously, and else is used to include everything except things mentioned above. Look ate the following example for reference:
import javax.swing.*;
public class InputPractice {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int x;
String s;
s = JOptionPane.showInputDialog("What did you get on your test?");
x = Integer.valueOf(s);
if (x >= 90)
{
System.out.println("That's an A! You did an Excellent job!");
}
else if (x >= 85)
{
System.out.println("That's a high B! Very Good job!");
}
else if (x >= 85)
{
System.out.println("That's a B! Good job!");
}
else if (x >= 70)
{
System.out.println("That's a C! That is an OK score. Try to do better next time.");
}
else
{
System.out.println("You should study much harder next time.");
}
}
}
The places where else, else if, and if were used should be chosen wisely.
Today, I learned howto get input from the user in java. I also learned about the if, else if, and else decision structures. The way we use these structures may affect the way our program is going to turn out. if is used when there is a specification for the result expected. else if is used to do the same thing, but it avoids any specifications made previously, and else is used to include everything except things mentioned above. Look ate the following example for reference:
import javax.swing.*;
public class InputPractice {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int x;
String s;
s = JOptionPane.showInputDialog("What did you get on your test?");
x = Integer.valueOf(s);
if (x >= 90)
{
System.out.println("That's an A! You did an Excellent job!");
}
else if (x >= 85)
{
System.out.println("That's a high B! Very Good job!");
}
else if (x >= 85)
{
System.out.println("That's a B! Good job!");
}
else if (x >= 70)
{
System.out.println("That's a C! That is an OK score. Try to do better next time.");
}
else
{
System.out.println("You should study much harder next time.");
}
}
}
The places where else, else if, and if were used should be chosen wisely.
Monday, October 15, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today, I learned about another primitive type in java: Boolean. This is a primitive that returns only two results: true or false. This is a very important part of java. I learned about operators very important in java like !=, ==, !, , and others. These are very important operators. I plan to excell in these operators next class.
Today, I learned about another primitive type in java: Boolean. This is a primitive that returns only two results: true or false. This is a very important part of java. I learned about operators very important in java like !=, ==, !, , and others. These are very important operators. I plan to excell in these operators next class.
Wednesday, October 10, 2007
What problems did you encounter while developing your solution? How do you plan to overcome them?/How did you overcome them?
When I ran my driver classes for the classes I wrote, I saw that there were problems with the interaction between the two classes. Sometimes, the problems were errors in the codes written. Other times, they were problems that had to do with the compiler (i.e. I wrote them they way I thought they should be, but the compiler interpreted them differently). Whenever I had such problems, I went back and analyzed the specific places where there were problems and tried to fix them. When I was stack, I asked my teacher. I finally had all my classes working just fine.
When I ran my driver classes for the classes I wrote, I saw that there were problems with the interaction between the two classes. Sometimes, the problems were errors in the codes written. Other times, they were problems that had to do with the compiler (i.e. I wrote them they way I thought they should be, but the compiler interpreted them differently). Whenever I had such problems, I went back and analyzed the specific places where there were problems and tried to fix them. When I was stack, I asked my teacher. I finally had all my classes working just fine.
Tuesday, October 9, 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.
The equal sign in Java is used for assignments. It is really crucial to know the difference between the = sign in Mathematics and Java. In Math, the two things that are set equal have exactly the same value and no assignment is done. However, in Java, the entity to the right of the = sign is assigned to the entity on the left side.
Example:
public SimpleCalculator(double x, double y)
{
sumTotal = x;
productTotal = y;
}
//is very different from:
public SimpleCalculator(double x, double y)
{
x = sumTotal;
y = productTotal;
}
On the first one, the x and y values are assigned to the sumTotal and productTotal values. But in the second one, the reverse is done. So it is very important to know the real meaning of the "assigner" in Java.
The equal sign in Java is used for assignments. It is really crucial to know the difference between the = sign in Mathematics and Java. In Math, the two things that are set equal have exactly the same value and no assignment is done. However, in Java, the entity to the right of the = sign is assigned to the entity on the left side.
Example:
public SimpleCalculator(double x, double y)
{
sumTotal = x;
productTotal = y;
}
//is very different from:
public SimpleCalculator(double x, double y)
{
x = sumTotal;
y = productTotal;
}
On the first one, the x and y values are assigned to the sumTotal and productTotal values. But in the second one, the reverse is done. So it is very important to know the real meaning of the "assigner" in Java.
Monday, October 8, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today, I worked more on writing classes. I wrote a class for determining Roach population and another class that is a simple calculator. It was really interesting and I believe that I am getting much better at writing classes. Next class, I plan to write more classes and their testers so I could be very good at writing classes.
Today, I worked more on writing classes. I wrote a class for determining Roach population and another class that is a simple calculator. It was really interesting and I believe that I am getting much better at writing classes. Next class, I plan to write more classes and their testers so I could be very good at writing classes.
Friday, October 5, 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?
I worked on creating more classes today. I learned that when ever you use a method in a testing program, you should never forget the parenthesis that come after it. I learned this when I tried running a program and I found out that there was an error, which was an absence of the () after the method I was referring to.
Example:
System.out.println("The perimeter of rectA is: " + rectA.getPerimeter());
The () after the getPerimeter method are very crucial in this code.
what you suggest benefit that person in solving the problem?
I worked on creating more classes today. I learned that when ever you use a method in a testing program, you should never forget the parenthesis that come after it. I learned this when I tried running a program and I found out that there was an error, which was an absence of the () after the method I was referring to.
Example:
System.out.println("The perimeter of rectA is: " + rectA.getPerimeter());
The () after the getPerimeter method are very crucial in this code.
Thursday, October 4, 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.
Look at the following code:
public Rectangle(double x, double y, double width, double height) //creating the edges of the rectangle
{
myX = x;
myY = y;
myWidth = width;
myHeight=height;
}
// now the methods
public double getPerimeter()
{
double perimeter;
return perimeter = myWidth + myWidth + myHeight + myHeight;
}
Here myWidth has to be used when calculating the perimeter instead of width because width is an unspecified variable. This code, for example, would not work:
...
return perimeter = width + width + height + height;
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.
Look at the following code:
public Rectangle(double x, double y, double width, double height) //creating the edges of the rectangle
{
myX = x;
myY = y;
myWidth = width;
myHeight=height;
}
// now the methods
public double getPerimeter()
{
double perimeter;
return perimeter = myWidth + myWidth + myHeight + myHeight;
}
Here myWidth has to be used when calculating the perimeter instead of width because width is an unspecified variable. This code, for example, would not work:
...
return perimeter = width + width + height + height;
Wednesday, October 3, 2007
How did you go about testing your program? What were the results of that testing?
Today I finished my MPG assignment, which was a program that needed two classes. It was very interesting, but also challenging. After I finished the first class, I made another class to see if my first class works properly. When I ran the testing class, I turned out to be queer, which meant that my first class had errors in it. Thus, I went back and looked at the problems, which were hard to identify, and solve. Finally, after making all the solutions to my first class, I went back to the testing class and ran it. It worked this time. Mission Accomplished.
Today I finished my MPG assignment, which was a program that needed two classes. It was very interesting, but also challenging. After I finished the first class, I made another class to see if my first class works properly. When I ran the testing class, I turned out to be queer, which meant that my first class had errors in it. Thus, I went back and looked at the problems, which were hard to identify, and solve. Finally, after making all the solutions to my first class, I went back to the testing class and ran it. It worked this time. Mission Accomplished.
Tuesday, October 2, 2007
What problems did you encounter while developing your solution? How do you plan to overcome them?
Today, I worked on developing a class as a basis for another class. Developing this class was different from anything I did before, and so it was difficult. I did not know what exactly to do and how to use the methods properly. I used the program I made yesterday(Bank Account) to help me. With more practice I will hopefully be better at this.
Today, I worked on developing a class as a basis for another class. Developing this class was different from anything I did before, and so it was difficult. I did not know what exactly to do and how to use the methods properly. I used the program I made yesterday(Bank Account) to help me. With more practice I will hopefully be better at this.
Monday, October 1, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today in class, I learned how to carefully design the classes I need before any coding is done. I also learned about the importance of doing this. Unless, I have something primary to base my coding on, my programs are not going to be of any effect. These procedures seem to be intricate, and I am sure I need to look at them very closely before fully understanding everything that is going on. We started the lesson by making a code that takes care of a person's bank account. This afternoon and tomorrow, I plan to study these methods and master them before I learn something new.
Today in class, I learned how to carefully design the classes I need before any coding is done. I also learned about the importance of doing this. Unless, I have something primary to base my coding on, my programs are not going to be of any effect. These procedures seem to be intricate, and I am sure I need to look at them very closely before fully understanding everything that is going on. We started the lesson by making a code that takes care of a person's bank account. This afternoon and tomorrow, I plan to study these methods and master them before I learn something new.
Wednesday, September 26, 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.
Today, I learned about a static class called Math. As primitives do not have a class (unlike strings), the Math method is used to do special calculations. It contains sqrt (square root), abs (absolute value), and many other similar methods. Here is an example:
double a=16;
System.out.println(Math.sqrt(a));
//this would print 4.0
This is, thus, a very useful method.
Today, I learned about a static class called Math. As primitives do not have a class (unlike strings), the Math method is used to do special calculations. It contains sqrt (square root), abs (absolute value), and many other similar methods. Here is an example:
double a=16;
System.out.println(Math.sqrt(a));
//this would print 4.0
This is, thus, a very useful method.
Tuesday, September 25, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today, I learned about the string method and how it is different from primitives. This method is used to declare and assign values to codes in written form. Here is an example:
String s="hello";
This would assign hello to s. I plan to master this method in the next class.
Today, I learned about the string method and how it is different from primitives. This method is used to declare and assign values to codes in written form. Here is an example:
String s="hello";
This would assign hello to s. I plan to master this method in the next class.
Friday, September 21, 2007
What problems did you encounter while developing your solution? How do you plan to overcome them?/How did you overcome them?
Today, I tried to create a car using java. In order to create pictures using java, it is necessary to import some methods from the library. I imported these methods during the first days of school, and, unfortunately, I did not remember how to import a library. So I tried to right click on the project and figure out what to do. My teacher, Ms. Petr, helped me on this, and now I know how to import something. Once I imported apcslib to my program, things worked out easily.
Today, I tried to create a car using java. In order to create pictures using java, it is necessary to import some methods from the library. I imported these methods during the first days of school, and, unfortunately, I did not remember how to import a library. So I tried to right click on the project and figure out what to do. My teacher, Ms. Petr, helped me on this, and now I know how to import something. Once I imported apcslib to my program, things worked out easily.
Thursday, September 20, 2007
How did you go about testing your program? What were the results of that testing?
As it was my goal to, today I worked on mastering the number operations on java. I worked on practice problems so that I would get used to the methods. I wrote a program to see what the results turnout to be and I realized the importance and purpose of Casting. Look at the following coads :
double d=61/20; // this would make d 3.0. However,
double d=(double)61/20; // would be 20.3333333333
This shows how crucial Casting is. I also learned other methods and writing and testing my program helped me learn even more.
As it was my goal to, today I worked on mastering the number operations on java. I worked on practice problems so that I would get used to the methods. I wrote a program to see what the results turnout to be and I realized the importance and purpose of Casting. Look at the following coads :
double d=61/20; // this would make d 3.0. However,
double d=(double)61/20; // would be 20.3333333333
This shows how crucial Casting is. I also learned other methods and writing and testing my program helped me learn even more.
Tuesday, September 18, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today in class, I learned about data types and how to operate mathematical functions while using java. I learned about such methods as int, double, Boolean, etc. These are very interesting characters and they are very useful at the same time. There is a trick to using them all the right way. Today, I learned them all, and I am going to spend some time studying them and committing them to memory. Next class, I will work on mastering these methods.
Today in class, I learned about data types and how to operate mathematical functions while using java. I learned about such methods as int, double, Boolean, etc. These are very interesting characters and they are very useful at the same time. There is a trick to using them all the right way. Today, I learned them all, and I am going to spend some time studying them and committing them to memory. Next class, I will work on mastering these methods.
Monday, September 17, 2007
What choices did you face in developing your solution, and how did you choose among them?
Today, I used the System.out.print method to draw an animal on the console screen. It was very interesting. There are many tricks to this method. One of them is using System.out.println to proceed to the next line and write something different. I used that method and was able to draw the face of a cat like animal on the console window. The println method helped out a lot. It was like a shortcut to going to the next line. When I was done writing the code, I run it, and it turned out looking very nice.
Today, I used the System.out.print method to draw an animal on the console screen. It was very interesting. There are many tricks to this method. One of them is using System.out.println to proceed to the next line and write something different. I used that method and was able to draw the face of a cat like animal on the console window. The println method helped out a lot. It was like a shortcut to going to the next line. When I was done writing the code, I run it, and it turned out looking very nice.
Friday, September 14, 2007
What choices did you face in developing your solution, and how did you choose among them?
Today, I learned about the importance of every line in a public static void main (String[] args) method. Furthermore, I learned about a method that looks like this:
system.out.print();
This is used to print numbers and letters on the console screen. I learned that I could use methods like "\n", \\n, and ln to make the programs less tedious. These are very important tools when, for example, I want to go to a new line.
Today, I learned about the importance of every line in a public static void main (String[] args) method. Furthermore, I learned about a method that looks like this:
system.out.print();
This is used to print numbers and letters on the console screen. I learned that I could use methods like "\n", \\n, and ln to make the programs less tedious. These are very important tools when, for example, I want to go to a new line.
Wednesday, September 12, 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.
Today I learned how to incorporate colors with my drawings. I used a document to see what I need to do to draw colored lines. The code:
import java.awt.Color;
.
.
setColor (Color.red);
The first part imports the file that the compiler needs to have in order to set in colors. The second part is just used to show the compiler where the color is needed and what color it is.
Example:
marker.up();
marker.move(5,-100);
marker.down();;
marker.setColor(Color.blue);
marker.move(5,-75);
marker.move(20,-50);
This code was used to make a door. The marker.setColor(Color.blue); makes the lines used to make the door blue.
This is a very important tool to use in programming.
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.
Today I learned how to incorporate colors with my drawings. I used a document to see what I need to do to draw colored lines. The code:
import java.awt.Color;
.
.
setColor (Color.red);
The first part imports the file that the compiler needs to have in order to set in colors. The second part is just used to show the compiler where the color is needed and what color it is.
Example:
marker.up();
marker.move(5,-100);
marker.down();;
marker.setColor(Color.blue);
marker.move(5,-75);
marker.move(20,-50);
This code was used to make a door. The marker.setColor(Color.blue); makes the lines used to make the door blue.
This is a very important tool to use in programming.
Tuesday, September 11, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today, I worked a lot an drawing methods. It is really interesting to use java to draw pictures. I mastered methods such as move, forward, turnRight, turnLeft, up, down, etc. I learned how the worked and applied them in many of my drawing programs. The worked very well and I had a lot of fun working with them. My drawings came out to be very nice and just as I expected them. Next class, I would like to master these methods and make my way to even complicated methods.
Today, I worked a lot an drawing methods. It is really interesting to use java to draw pictures. I mastered methods such as move, forward, turnRight, turnLeft, up, down, etc. I learned how the worked and applied them in many of my drawing programs. The worked very well and I had a lot of fun working with them. My drawings came out to be very nice and just as I expected them. Next class, I would like to master these methods and make my way to even complicated methods.
Monday, September 10, 2007
What problems did you encounter while developing your solution? How do you plan to overcome them? How did you overcome them?
Today, while trying to program a smiley face, I made some errors. I looked at the errors and I tried to see what was wrong. After analyzing my problems, I asked my teacher what to do, and using the hints she gave me, I corrected my mistakes. I run the program and it ended up being very interesting. Achieving my goal made me very happy.
Today, while trying to program a smiley face, I made some errors. I looked at the errors and I tried to see what was wrong. After analyzing my problems, I asked my teacher what to do, and using the hints she gave me, I corrected my mistakes. I run the program and it ended up being very interesting. Achieving my goal made me very happy.
Friday, September 7, 2007
How did you go about testing your program? What were the results of that testing?
Today, I made my firs diagrams on Java. It was really a lot of fun. I first wrote the code and tried to run the program. Before running the program, I checked to see if there were any mistakes in the code, and there were. With the help of my teacher, Ms. Petr, I identified my mistakes and learned how to correct them. When I finished the code and run it, it felt like a great accomplishment. I am going to challenge myself by making other programs that are more intricate.
Today, I made my firs diagrams on Java. It was really a lot of fun. I first wrote the code and tried to run the program. Before running the program, I checked to see if there were any mistakes in the code, and there were. With the help of my teacher, Ms. Petr, I identified my mistakes and learned how to correct them. When I finished the code and run it, it felt like a great accomplishment. I am going to challenge myself by making other programs that are more intricate.
Thursday, September 6, 2007
What progress did you make today on your solution? What needs to be completed next class?
Today I was given an introduction to Java. I used a code that was fairly simple to run a program that says Hello PBHS!
The code:
public class Hello {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Hello,PBHS!");
}
}
This introduction was really interesting and I am really excited about doing more programs. I am sure that this will be a lot of fun, but also challenging.
Today I was given an introduction to Java. I used a code that was fairly simple to run a program that says Hello PBHS!
The code:
public class Hello {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Hello,PBHS!");
}
}
This introduction was really interesting and I am really excited about doing more programs. I am sure that this will be a lot of fun, but also challenging.
Subscribe to:
Posts (Atom)