Thursday, October 27, 2011

October 27th

I hate atomic learning.
sorry. But I really do.
Atomic learning sucks because


there are so many videos...
and it doesn't help you unless you are looking for a specific problem..
So I watched like 2 videos and quit ... :P

How to animate your logo in Adobe Flash CS3 looks interesting 
http://www.youtube.com/watch?v=uTNdXqIbNrg&feature=related

Wednesday, October 26, 2011

October 25th

It took me a while to download the whole program. I wanted to only select the flash file but I didn't know for sure what to download. So I downloaded the 'whole' thing. :P

My first project will be making things flash and glitter
like http://www.youtube.com/watch?v=gUKXfoubkEI

I also found a great tutorial
http://webdevfoundations.net/fireworkscs3/page7.htm

I guess I am ready to flash! hahhah 

After coming out of AP computer science.

First, I thought I would understand coding over time. But I came to a conclusion last weekend that that day will never come to me. So here I am in computer application.... :)  

Wednesday, October 19, 2011

coding bat!!!

I don't enjoy coding bat.
but I want the 'feeling' of the new era thing.
SO.
I MUST
AND I WILL.
DO THE PROBLEMS.

Chapter 4 test

1. Find the two problems.

First problem
private ArrayList listOfStudents;
Since our book is the 2nd edition not the 4th, you need to write down the after the ArrayList! why? so the computer knows what type you are storing.

Second problem
When you run 'Admin', John's GPA doesn't stop. So I have to make it stop. It doesn't stop because the loop isn't fully coded.
I knew that it had to do with i++;

int index =0;
while (index
{
System.out.print(seniors.getStudent(index).getName());
System.out.println(""+ " " + seniors.getStudent(index).getGPA());
index++;
And since the i value is index, you write index++;

2. Add a new student to class Admin with 4 courses. Run the class. Does it behave as expected?
yes it Compiled. I thought it would not compile because the two students had three courses. So I thought they would not recognize the fourth course.


seniors.add(new Student("Yejun"));
seniors.getStudent(2).addCourse(new Course ("English",99));
seniors.getStudent(2).addCourse(new Course ("Math",99));
seniors.getStudent(2).addCourse(new Course ("History",99));
seniors.getStudent(2).addCourse(new Course ("Band",100));

3. Implement method setGPA() of class Student. Should this method be private or public? Explain.
I think this should be private because then anyone would access and mess up the GPA.



public void setGPA()
{
int sum=0;
for(int i=0; i<courseList.size(); i++)

sum = sum+ (courseList.get(i).getGrade());

GPA=sum/numberOfCourses;
}

Part 2



4. The toString() method is inherited (from class Object) by class Student (all Java classes inherit from the Object class). What is the output when this method is called on a Student object?

public String toString()
{
String result = "";
for(int i=0; i
{
result = result + courseList.get(i).getCourseTitle() + ", ";
}
return name + ": " + result;
}



5. Create a new field in StudentList named deansList that holds a list of students who are on the Dean's List. ( GPAs of 88 or higher.)

public String deanKids()
{
for(int i=0; i
{
if(listOfStudents.get(i).getGPA() >= 88)
{
deansList += listOfStudents.get(i).getName();
}
}
return deansList;
}

thanks Michael... :P


6. Create a method named printDeansList() that prints the names of students on the Deans List with their GPAs. Each student should be printed on a new line.

printdeansList()
public void printDean()
{
for(int i=0; i
{
if(listOfStudents.get(i).getGPA() >= 88)
{
System.out.println(listOfStudents.get(i).getName() + " " + listOfStudents.get(i).getGPA());
}
}
}


7. Create a method named findTopStudent() that finds the student with the highest GPA and prints..
(example) The top student is Mario with a GPA of 98

findTopStudent()

public void topStudent()
{
for(int i=1; i
{
if(listOfStudents.get(i).getGPA() >= listOfStudents.get(bestStudent).getGPA())
{
bestStudent = i;
}
}
System.out.println(listOfStudents.get(bestStudent));
}
System.out.println(listOfStudents.get(bestStudent));
}


copyright to Michael..

Sunday, October 9, 2011

Chapter 4 questions

the link is here
https://docs.google.com/document/d/1EbGHNy0l8_VF746EPBE-cjiamIHpWOgUdpDY9xCKIJ0/edit?hl=en_US

AHHHHHHHHHHHH
WE ARE ALREADY IN CHAPTER 4
OMGOMGOMGOMGOMGOM

heheheheehhehe
i enjoy so much being silly 

Saturday, October 1, 2011

Chapter 3 test

Explain the purpose of class ConvertToCents
You need a class to convert into cents because then you will know how many quarters, dimes, nickels I will need. So like if you have 1.5 cents, the code will give us 1 cent and 2 quarters...(right?)

I... keep on getting this error called

java.lang.NullPointerException
at Transaction.getChange(Transaction.java:32)

Null... I feel like I heard that very very often... .