Tuesday, January 27, 2009

ICA-CP: 1/27/09

Good morning!

All of the grades I have for Q3 are in Powerschool. This includes three Question of the Week blogs with the topics of: terroists using MySpace, trauma and stress reduction by playing video games, and the impact of eletronic waste on the environment (required 2 links in addition to response). This is a reminder of how your blogs are graded.

1) Blogs are worth 25 points maximum for answering the question of the week on time with at least 250 words and with research links as required.
2) If your blog is less than 250 words but is submitted on time, you do not get full credit. You get 1 point for each 10 words maximum. That means, even though your response is short, it must be thoughtful.
3) If your blog is late, 5 points are deducted.
4) If your blog does not have required research links, 5 points are deducted.

Grades in Powerschool do not look very good right now. Most of the class needs to do the homework in the Fundementals of Java textbook and re-take the tests. On the Java Syntax part of the test, the highest score was 88 out of 105 points (84%). On the data types portion, it was 43 out of 70 points (61%).

This week, you all have homework most likely. Also this week, your Eliza programs are due on Thursday. I think it's going to be a hectic one!

Friday, January 23, 2009

ICA-CP: Not satisfied with your test results?

If you aren't satisfied with your test score, you may make up points by doing homework and re-taking the test. My concern is that you understand the material. So, in order to make up points, complete the Chapter 3 and Chapter 4 exercises listed below by writing the answers on paper in pen or pencil. (In other words, no cutting and pasting from anywhere into a document. You must think about your answers.) These exercises are due on Wednesday, 2/4/09, at the beginning of class if you wish to have the extra points. If you turn in the Chapter 3 and Chapter 4 exercises, then you may re-take the test on Monday, 2/9/09. I will count your highest test scores and add the Chapter 3 and 4 exercises points to your scores, up to a maximum of 175 points.

Chapter 3 - Worth a maximum of 30 points

pp. 54-55, Exercise 3.2 #1-5
p. 57, Exercise 3.2 #6-11
pp. 61-63, Exercise 3.2 #12-17
pp. 65-66, Exercise 3.2 #18-22
pp. 68-69, Exercise 3.2 #23- 27
p. 70, Exercise 3.3 #1-2
p. 71, Exercise 3.4 #1-2
p. 80, Exercise 3.5 #1-3
pp. 86-87, Written Review Questions #1-6 and Fill In the Blank questions #1-5

Chapter 4 - Worth a maximum of 30 points
p. 92, Exercise 4.1 #1-2
p. 95, Exercise 4.2 #1-2
pp. 100-101, Exercise 4.5 #1-7
p. 105, Exercise 4.5 #1-6
(Skip Exercise 4.6)
p. 109, Exercise 4.7 #1-3
p. 112, Exercise 4.8 #1-2
p. 119, Exercise 4.9 #1
pp. 121-123, Written Review Questions #1-5

If you do not turn-in both Chapter 3 and Chapter 4 exercises with answers to all of the questions, you may not re-take the test.

ICA-CP: 1/23/09 - Test in Quia today

Good afternoon!

Today is test day. You may use your own, not someone else's, notes and the class blog for this test. Your test is in two parts. You may take the test two times. You have our whole class period to complete the two parts. The password is: spartans

The data types portion of your test has 31 questions and is worth 70 points. The link to it is: http://www.quia.com/quiz/1322876.html

The Java syntax part of your test has 42 questions and is worth 105 points. The link to it is: http://www.quia.com/quiz/1481842.html

Take a deep breath. Relax. You can do this!

Wednesday, January 21, 2009

Question of the Week: Due 1/30/09

[At least 250 words on the Question of the Week topic are due by 5:00 PM on Friday, 1/30/09 for a maximum of 25 points. In addition, you must place links to at least two other articles which you have found in your blog.]

Background: Did you know that there are free versions of Microsoft Word, Microsoft Office, and Microsoft Excel -- colletively called Microsoft office? Yes, and it doesn't cost $150.00. It is called OpenOffice, and is installed on the computers in the ERC and in 403. Firefox is also free. These programs belong to a kind of software that is copyrighted but shared for free use called Open Source software. The operating system called Linux is also Open Source software. By using Open Source software, business and home users may save themselves thousands of dollars in costs. Many governments in Europe and China use Open Source software. Well, President Obama's administration is considering using Open Source for government computers. See this article: http://news.bbc.co.uk/2/hi/technology/7841486.stm. There is more info about Open source at these links:

Definitions of Open Source:
http://www.opensource.org/docs/definition.php
http://en.wikipedia.org/wiki/Open_source

Utah Open Source Foundation: http://blog.utos.org/

Questions: Would you use Open Source software at home? If yes, estimate how much money you would save. Would you suggest it for business use? What are some programs in addition to OpenOffice, Firefox, and Linux that are Open Source? Be sure to find two links to articles on Open Source and put them in your blog along with your response.

ICA-CP: 1/21/09 - More review

Good morning!

Last class we reviewed Java syntax. Be sure to take good notes! In addition to your notes, here is a good Java Cheet Sheet web site.

For the test on Friday, you may use your own notes and no one else's notes. Remember, the goal is for you to learn the syntax and not what your friends know about Java syntax. Also, you will not be allowed to use any web resources. Once again, your test will cover Java datatypes and syntax. Be sure to understand the following top 10 concepts:
1) Java keywords and the rules about using them. Keywords include print, println, class,=, main, ==, if, if/else, while, for,new, //, and /* plus */. Know the what they do and the rules for using them.
2) Where to use pairs of braces, parentheses, and square brackets. Be able to identify blocks of code. Know when to use a semicolon versus pair of braces, parenthesis, and square brackets.
3) Java dataypes abstract and primitive, and examples of types within those two main categories. This includes string arrays (be able to code a string array in Java given a list like "mad, glad, and elated"), literals, rules and syntax for casting, the format to declare a variable, the sizes in number of bits of different primitive datatypes along with the largest numbers those bits may represent, and the difference between a value and a variable (especially in a string aray).
4) How to declare a variable and assign the variable an optional initial value.
5) Being able to explain the difference between the two control statements of for and while.
6) Being able to list the four actions this particular line of code does: KeyboardReader rr = new KeyboardReader().
7) Knowing how to identify a method, a primitive dataype, and an abstract datatype.
8) The order and necessary parts of a Java program: import followed by the class followed by the maid method, including the convention for naming classes and methods.
9) Being able to read Java code and what it will do, especially being able to distinguish the difference between a print and a println output on a screen.
10) Know what an import statement does and how to make sure the library is available.

So, we will review some more today. then spend some time working on Eliza. Your test is online at Quia, and consists of two parts. Part 1 covers Java data types. It consists of 31 questions worth 70 points. Part 2 consists of 42 questions and 105 points, covering Java syntax concepts.

Wednesday, January 14, 2009

ICA-CP: SEXI for Java datatypes

Java Datatypes

State:
There are two broad categories of datatypes in Java, primitive data types which are "built-in" and abstract datatypes, like String and KeyboardReader, which require a library to be imported in order to use them. There are seven basic primitive data types. They are bit, nybble, byte, char, boolean, int, and double.

Size matters with primitive datatypes. It matters because hardware memory is reserved for use by a variable when it is declared based on the datatype. The following are the sizes of the primitive datatypes:
1) bit - may be a 1 or a 0 (zero)
2) nybble - 4 bits
3) byte - 8 bits
4) char- 2 bytes or 16 bits; may be character values
5) int - 4 bytes or 32 bits; may be integer values
6) double - twice the size of an int at 8 bytes or 64 bits
7) boolean - 1 which is True or 0 (zero) which is False

Of the other datatypes that we have used, the datatype String is multiple "char" types or multiple characters in size.

The size of a variable's datatype determines what kind of value a variable can represent. A variable of datatype bit can only be a 1 or zero. If I declared this variable:

bit myBit;

I could never assign it the value of 3 or 6 or 999. The largest number that myBit can represent is just one. It is similar for an int declaration of:

int numberOfStarsInTheGalaxy;

Could I represent a googol with numberOfStarsInTheGalaxy? Well . . . since a googol is a 1 followed by 100 zeroes or this number:

10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

and since the largest number an int can represent is 2147483647, I think the answer is a definitely "negatory!" Could a googol fit in a double datatype (hint: a double is 64 bits big)?

Elaborate:
The size of the datatype determines how high one may count or how many characters one may have. For example, since a bit is 1 or zero, the highest one may count is 1. With an int datatype, 1 bit is used for the positive or negative integer sign leaving 31 bits for representing the integer number. If every one of the 31 bits for counting is a one, we would have 31 ones: 1111111111111111111111111111111 (I think that's 31). If we put those 31 ones into a scientific calculator in the binary counting system, then change the counting system in the calculator to decimal, we find that 31 ones in binary equal 2,147,483,647. So, that's the largest positive number we can represent with an int datatype. The largest negative number for an int is -2,147,483,648. For the double datatype, one bit is used for the sign and the remain 63 (out of 64 bits) is used to represent the number value. For the char datatype, the largest amount of data that can be represented is one character. For String, multiple characters may be represented.

Casting is changing the datatype of a variable from a larger datatype to a smaller one. (One cannot cast from a smaller datatype to a larger.) So, if I declare an variable of datatype int, for example:

int myVar = 2147483647

I can cast myVar into a smaller datatype like bit:

(bit) myVar;

Please notice that when casting, I place parentheses around the datatype in the cast statement.

So, myVar which was 31 bits of data as an int becomes one bit of data as a datatype of bit. But, when I do that, the difference in bits is lost or cut off. That is, 30 bits are truncated or cut off. So, after I cast from an int to a bit, the value of myVar (which was 2,147,483,647 when it was datatype int) becomes one since I now only have one bit. To trunctate means to cut off and throw away the rest of the bits that are larger than the new datatype can handle.

Exemplify:
Here's another example of casting. I have this variable declaration:

String myVar = "Hello World";

I cast it into char:

(char) myVar;

Since myVar after it is cast is only one character long, the rest ("ello World!") is truncated or cut off. After I cast myVar down from a String to a char, the value of myVar becomes just the letter, "H".

Why is it that we can cast only from larger to smaller datatypes? Remember that when a variable is declared in Java, memory space in the hardware is set aside for it. For example, if I declare:

int myAge;

the computer sets aside 32 bits in memory for the use of the variable, myAge. I can cast myAge to any datatype smaller than 32 bits because the space is already set aside in the computer. I cannot cast myAge into a datatype larger than 32 bits because there is simply not enough space in the computer's hardware memory set aside for it.

Illustrate:
So, using datatypes in Java and casting is much like buying milk in different sizes of containers. I can have a cup, pint, quart, half-gallon, or gallon container of milk. The milk container size is like the size of the datatype. When I cast from one datatype to another, I could put a cup of milk into a quart sized container. But, I could never fit a gallon of milk into a pint-sized container.

Monday, January 12, 2009

ICA-CP: 1/12/09

Good morning!

I'm home sick today. So, here's what you do:

1) Find the brain food in the closet.
2) Finish your Eliza programs today.
3) In you run out of things to do, do the Question of the Week due this week.
4) If you finish this week's Question of the Weekm do the Question of the Week due next week. (BTW, this one really makes me mad!!! It's how our electronic waste gets sent to other countries. As people process the waste, the workers and their children become sick!)

See you all on Wednesday!

Question of the Week - Due 1/23/09

[At least 250 words on the Question of the Week topic are due by 5:00 PM on Friday, 1/23/09 for a maximum of 25 points. In addition, you must place links to at least two other articles which you have found in your blog.]

Background: What do YOU do when your cell phone or ipod break ("oops, it fell in the sink when I was brushing my teeth")? Do you throw them in the garbage can? What really happens when you take your old computer to a recycle center? According to a Time magazine article, we throw out more than 130,000 computers and 350,000 cell phones each and every day! This garbage goes to poorer counties, like China, where children are becoming sick from our hazardous waste. Below are some background articles for you.

Time magazine article: http://www.time.com/time/magazine/article/0,9171,1870485,00.html


China's Electronic Waste Village: http://www.time.com/time/photogallery/0,29307,1870162,00.html?iid=redirect-ewaste

What Greenpeace has to say: http://www.greenpeace.org/international/campaigns/toxics/electronics/the-e-waste-problem

Donating to other countries creates problems: http://www.isa.org/Content/ContentGroups/News/20051/April28/Pintos_Point__The_serious_problems_of_e-waste.htm

Questions: What can be done about e-waste polluting the environment and causing illness? What can you personally do about limiting the amount of e-waste you create? How does e-waste potentially adversely affect our health and the health of those in countries where e-waste is processed? Is sending our electronic garbage to poorer nations just and fair? NOTE: In your answer, you must research and find at least two other articles (in addition to those I've given you above) in web sites to prove your argument. Each electronic citation must be relevant to your answer and is worth a maximum of 5 points (for a total of 10 out of the possible 25 points). Refer to the web sites you cite in your answer.

Thursday, January 08, 2009

Question of the Week: Due 1/16/09

[At least 250 words on the Question of the Week topic are due by 5:00 PM on Friday, 1/16/09 for a maximum of 25 points.]

Background: Post traumatic stress disorder (PSTD)can happen to you after experiencing a very terrible event. For more information on PSTD, see this web site: http://brainline.org/content/content.php?name=ptsd-fact-sheet-frequently-asked-questions&gclid=COHLs4LI_5cCFQkzawod1VvT1Q. A new released study from Oxford University indicates that playing the video game, Tetris, may help to reduce the effects of traunma: http://news.bbc.co.uk/2/hi/health/7813637.stm. Other studies show that playing video games may help reduce general stress levels. See these two web sites:

http://gigaom.com/2008/04/28/study-shows-games-help-reduce-stress/

http://www.dmwmedia.com/news/2007/10/24/video-game-shown-to-reduce-stress-hormone-levels

Question: What is your opinion of using video games to reduce stress? Does it work for you? Or, do some video games increase your stress levels instead of reducing them?

Question of the Week: Due 1/9/09

[At least 250 words on the Question of the Week topic are due by 5:00 PM on Friday, 1/9/09, for a maximum of 25 points.]

Background: Many of us have Facebook, MySpace, or Twitter accounts, and we use them to keep in touch with our friends as well as to meet new friends. The Internet has created a way for us to connect with people socially, usually for good causes or sensible reasons. But, there is another use for online networking. Terrorists are using online networks to recruit new members. See the article in PC World for more details: http://www.pcworld.idg.com.au/article/272364

Question: Should we be concerned about this trend? If yes, then why. If no, then why not?

ICA-CP: 1/8/09 - Calendar for this and next week

Good morning!

We continue with our Eliza programs today. We will have a brief review of the pseudo-code we reviewed before Christmas break -- which is still on the board.

Here's a brief calendar for this week and next:

1) 1/8/09, Thursday - Work on Eliza program
2) 1/12/09, Monday - Eliza programs are due
3) 1/14/09, Wednesday - Review of Java syntax, array, and datatype concepts for a test
4) 1/16/09, Friday - Review of Java syntax, array, and datatype concepts for a test
5) 1/21/09, Wednesday - Online test of Java command syntax, arrays, and datatypes worth about 200 points.

The Java concepts include: for, while, import, structure of a class with a main method, declaring arrays and variables (with datatypes of int, String, bit, boolean, double, char, and nybble), casting, if and if/else, the concept of blocks, how to name variables and classes, import, =, ==, String library methods including equals, abstract and primitive datatypes, instantiating an object, print, println, end of line and multi-line comments, and perhaps a few others.

ICA-CP: 1/6/09 - Contiinuing with Eliza

Greetings!

This is a recap of our class on Tuesday.

(1) Our Eliza programs are due by the end of class on Monday since no one finished before the end of the semester. Please see the ICA-CP: 12/3/2008 - Eliza class blog for the original details. Here are amended details since you didn't finish your programs.

On the Eliza Check-Off List which your team turned into me:
(a) Your 7 emotive words and responses per person are worth 25 points.
(b) Your algorithm is worth 25 points.
(c) Your pseudocode is worth 25 points.
This is a possible 75 points that will go onto Quarter 3 grades.

(d) Your actual running program will go onto Quarter 4 grades with a potential point value of 125 points. The maximum point values are: 75 points for a basic program, 100 points for an intermediate program, and 125 points for an advanced program.

As of Monday, we will have spent 8 class meetings on our Eliza program. If you had spent classroom time wisely, that would have been more than enough time to complete a basic level program. Also, I asked on Tuesday's class whether anyone needed help and if anyone was stuck with little response. So, I assume all is going well with your programming. Plese note that no programs will be accepted after the end of class on Monday, 1/12/09. You should turn in your programs to me on Monday whether they are running or not for partial credit. In order to get credit for a running program, you must show me a running version AND have me initial a printout of the version of your Java program that you did show me.