Design Presentation & Reporting

Whats goes on in Design Presentation & Reporting

Lecture 7 – Java

This was probably one of the more useful Java video tutorials I have watched so far it summarised some of the things we have been doing and showed us the difference between the code we were writing in Karel and writing Java.

The first thing we went over was the terminology of CAST –  This means that this one data object/variable will be treated as a different type temporarily. We then moved on to look at the loop and a half which was briefly covered in lecture 6.

Mehren then showed us an alternative coding method that could be used instead of the loop and a half which features the keyword SENTINEL. We then wen’t over the Add IntegerList program so that we could see the SENTINEL and break commands in action.

Statements were next in this lesson we went over to particular types the for and the while here are examples of each statement:

 

for (init; test; step) {

statements

}

 

init

while (test) {

statements step

}

The difference between these statements is that the for loop is used for definite iteration,  so basically the for loop is used when we know how many times we want to do something. On the other hand the while loop is for indefinite iteration and is used when we don’t know how many times we want to do something.

Mehren then wen’t over a program that was similar to what we are doing in assignment 2 I found this useful and could work out  little bit more of the assignment but I am still struggling. I have the list of code Mehren provided in  my note book with the rest of the notes.

Methods was the next topic of conversation and what a method is , is a way to break down a program into smaller pieces. The difference between methods in java and Karel are in java you have parameters that go in and return a value in Karel no value is returned.

We then learnt about information hiding which is summarised down to if the correct parameters is used the method can be re used. We we then shown an example of creating a method in Java.

The next stage of the lecture was more statements we looked at multiple return statements which return more than one value. The next statement was predicate methods which are methods that return a boolean value.

We then looked at a full program and finished with how to return an object.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on December 16, 2013 by in Design Discourse Two, Java, Research and tagged , .
%d bloggers like this: