Tuesday, May 5, 2015

Activity 2.2.2 Introducing PHP

 1.       In Activity 2.2.1 you used a version of this site that was constructed entirely from HTML, JavaScript, and CSS. What do you think are the most important improvements made by using PHP and MySQL?

PHP is easy to leearn and makes different things easier to do.

2.       What language would you use if you wanted to access information on a server?

  • PHP.


3.      What language would you use to create a zoom feature for images on your website without putting any additional strain on the server?

  • HTML.


4.      What language would you use to put a pretty frame around a table on your website?


  • HTML.


5.      What purpose did the comments in 222indexB.php serve for you as you worked through this activity?
  • The comments helped me understand the code better as well as work through the activity with more ease.

Friday, February 13, 2015

Java Chapter 4


This chapter explained how instance variables are declared and also initialized. An instance cariable can be declared by typing the data type followed by the variable name. Initializing an instance variable i done through giving the variable an initial value, and that a referenced instance variable will return the default values or null if its a string or 0 if its an integer variable. 



The int variable size was not initialized
This will prevent compiling because it is a local variable
The value of the instance variables determines how the methods behave inside the class. Instance variables can be compared to what the class knows, and methods as what the class does - so, instance variables are the state, and methods the behavior, and the states can affect the behavior. This is seen in the two code snips below.


Arguments are passed into methods, and are also parameters - which is a local variable. If a method takes a parameter, it must have something passed to it.

 Instance variables will always get a default value; if a value is not assigned, it will default to one of four values, depending on the type.
Int = 0
float = 0.0
boolean = false
ref = null

Local vs Instance: Local variables are declared within a method, and must be initialized before use, or else it will not compile.Instance variables are declared within a class, but not within a method.










Wednesday, January 28, 2015

Java Chapter 3: Know Your Variables

In Chapter 3, I learned that variables are either reference variables, or primitive variables. When declaring a variable, you need to have a type and name for that variable. 

A reference variable value is the bits representing a way to get to an object on the heap. A reference variable is like a remote control. Using the dot operator (.) on a reference variable is like pressing a button on the remote control to access a method or instance variable.

A primitive variable value is the bits representing the value (5, ‘a’, true, 3.1416, etc.). Primitive variables are variables that hold fundamental values, like an integer, boolean, or float. They also come in sizes; these sizes include btye, short, int, and long.


Tuesday, January 20, 2015

Java Chapter 2: A Trip to Objectville

       In Chapter 2 I learned about Object-Oriented Developement in Java. OO lets you add onto code that already works, and keeps it nice and organized. Some of the things I learned are that ojects "talk" to each other by calling methods in each other. When java runs, it's nothing more than object 'talking' to each other. All java code is defined as a class. Instance variables are things the object knows about itself. They represent the state of the object, and a class is like a blueprint.

Tuesday, January 13, 2015

Head First Chapter 1 Java

       In chapter 1, I learned that java as many similarities to Python, but there are also a lot of differences. For example, both require a semicolon at the end of a sentence, and code blocks are defined by a pair of curly braces { }. For some differencesm if you were to set x equal to a string such as, "Hello!", in Python it would let you do that, but Java requires you to say what kind of variable it is, string x = "Hello!".


       I also completed the beer song and found the error. The error is that towards the end of the song, it would print 1 bottles of beer on the wall. You can fix this by moving the if (beersleft==1) and where you set "bottles" equal to word down under the beersleft = beersleft - 1 command.