Skip to main content

WSQ10 College Advice

3 min read

"Work is supposed to be something unpleasant you do to get money to do the things you actually like doing."  So wise. Changed my perspective on life.

Joel's Seven Pieces of Free Advice for Computer Science College Students:

 

1-Learn how to write before graduating. (Done (i think so))

"I won't hire a programmer unless they can write, and write well, in English." I think i'm qualified for that job.

Of course, as a programmer you have to know how to write so you can comment and document your code so other programmers can understand it and work with it instead of rewriting it. 

2-Learn C before graduating. (Haven't even started YET)

I've met  a few programmers who have told me C is the base of everything, like the Big Bang of programming, but it is true than in school we don't have any courses that teaches us C so i'll learn it by my own on vacations or some break. 

3-Learn microeconomics before graduating (No thanks(perhaps yes))

Well of course i have to learn to make business so i can make more moneyyyyyyyyyyyyyy.

4-Don't blow off non-CS classes just because they´re boring. (OFC i won't)

I do have to get a higher GPA, my current one is 2.9 and some ot these non-CS classes help me raise it but sometimes this courses can be very time consuming which is the part i have to get used to in order to get a higher GPA.

5-Take programming-intesive courses. (Seems like a good idea)

I haven't taken any intensive courses but i've done some Codecademy courses which are very helpfull to learn the basics that i need for my current classes.

6-Stop worrying about all the jobs going to India. (What?)

 I don't really think that moving to India is the only choice but for me the only thing that is important in order to move to a different country is that there is good opportunities, tasty food and kind and awesome people to learn from.

7-No Matter what you do, get a good summer internship. (Sounds good)

"By the time you graduate, you really should have a resume that lists a whole bunch of programming jobs." I have to inmediatly start working on this, otherwise noone will hire me in the future.

 

In conclusion these 7 advices will help me be one of the most complete programmers in the industry which will help me get a better job and position but first of all enjoy and love my job.

 

 

Gilberto Rogel García A1630171

 

WSQ08 YoSoy196

1 min read

I couldn't do it by myself cuz i stupid so i got help from other peoples blogs <3.

For me, the most complete blog was this : richardctc201 blog

What is a Lychrel number: http://www.p196.org/

At first it was a bit confusing but with Richard's explanation on his blog it became more clear what i had to do.

Link to my code: YoSoy196

Pictures:

Lower boundLower Bound

Upper BoundUpper Bound

Result

Results

Gilberto Rogel García A01630171

//

STUDY GUIDE

8 min read

What is an object, attribute and method? 

An object is an instance of a class - it's a concrete 'thing' that you made using a specific class. So, 'object' and 'instance' are the same thing, but the word 'instance' indicates the relationship of an object to its class.

This is easy to understand if you look at an example. For example, suppose you have a class House. Your own house is an object and is an instance of class House. Your sister's house is another object (another instance of class House). ObjectObject

Attributes are also data members and properties of a class, they are varaibles declared inside class, they describe the current state of an object.

Methods perform operations on objects that alreaedy exist, methods must be declared to return something, although it can be void.

What is abstraction? 

Abstraction is the process of hiding the implementation details and showing only the functionality. It is used to hide certain details and only showing essential features of the object. chozacastro´s blog

Example from Lynda: 

Lynda video example

This represents the superclass "Shape" which is also an abstract class. You can see it's an abstract class because of the "abstract" before "class Shape".

This class also has an abstract method which doesnt have any code inside because every subclass will make use of this method differently.

This is a subclass called "Rectangle" of the superclass "Shape" thats why we put "public lass Rectangle extends Shape, to make sure Rectangle is a descendant of Shape.

As you can see the class Rectangle is using the method CalculateArea with some code inside that will do the process of getting the area of the rectangle

So this is another subclass of the superclass Shape, this time it represents a Triangle and it has a method also called CalculateArea but with a different code than Rectangle because to calculate the area of a triangle is different than to calculate an area of a rectangle so obviously the method has to be different and this is what abstraction is for, to change the inside of the abstract method as many times as we want in the subclasses.

Finally, this is the main class.

Here we created the Shape "rectangulo" as a new Rectangle so when we use the method calculateArea() it will use the method in the subclass Rectangle and not the one in the subclass Triangle and as you can see it worked. I put 10 and 15 for lenght and width and it showed that the area is 150 which is correct.

Then we created the Shame "triangulo" as a new Triangle so when we use the method calculateArea() it will use the method in the subclass Triangle and not the one in the sublcass Rectangle and as you can see it worked again. i put 10 and 15 again but this time for height and base and the area is of course 75 because 10*15= 150 and 150/2 = 75.

 

 What is encapsulation?

In encapsulation the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class, therefore it is also known as data hiding. Luis Varga's blog

-Allows the programmer to hide the instance data definition.

-Protects the integrity of the instance data.

-Hides the methods implementatios, this ensures that data structures and operators are used as intended.

-Prevents outside access with protective barrier

Encapsulation Lynda Video

What are "has-a" and "is-a" relationships?

The has-a relationship means that one type of object contains another or is composed of another. Some examples are: a car has-an engine, a bicycle has-a wheel, and a coffee cup has coffee.

The is-a relationship means that one type of object is a more specific version of a general type. Some examples are: a car is-a vehicle, a bicycle is-a vehicle, and a coffee cup is-a cup. The is-a relationship is modeled with inheritance. Abstraction, "Has-a" "Is-a" Relationships, Encapsulation

What are the mechanics for class description (coding) in the JavaProgramming Language?

  • Defining a class creates a new object type with the same name
  • Every object belongs to some object type, it is an instance of some class
  • A class definition is like a template for objects: it specifies what attributes the objects have and what methods can operate them
  • The methods that operate on a type are defined in the class definiton fot that type Luis Vargas blog

What are visibility modifiers, their purpose and use in practice?

Public, Private, Protected and Package Protected(No Modifier)

Public

Public is the most well known of the Java keywords. Public is also the easiest of the Java access modifiers because of its nature. A variable or method that is public means that any class can access it. This is useful for when the variable should be accessible by your entire application. Usually common routines and variables that need to be shared everywhere are declared public. 

Private

Private helps to encapsulate your methods and variables most effectively. What do I mean by encapsulate? I mean that only things that should be able to access those methods and variables can do so. There is actually only one way a private method or variable can be accessed: within the class that defined them in the first place. Private variables and methods are those that are meant to be directly accessed by the Java class that owns them.

Protected

Protected variables and methods allow the class itself to access them, classes inside of the same package to access them, and subclasses of that class to access them.

Package Protected (No Modifier)

What happens if you do not put any of the Java access modifiers on your methods and variables? Java will still compile your code, so what gives? No access modifier at all means that the method or variable defaults to package protected. This means that only the same class and any class in the same package has access. You get all of the same access as protected minus the ability for subclasses to access the method or variable (unless the subclass is in the same package).
Java made easy

What is inheritance and Polymorphism?

Inheritance

Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.

Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike,RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number ofsubclasses:

A diagram of classes in a hierarchy.

The syntax for creating a subclass is simple. At the beginning of your class declaration, use the extends keyword, followed by the name of the class to inherit from:

class MountainBike extends Bicycle {

    // new fields and methods defining 
    // a mountain bike would go here

}

This gives MountainBike all the same fields and methods as Bicycle, yet allows its code to focus exclusively on the features that make it unique. This makes code for your subclasses easy to read. However, you must take care to properly document the state and behavior that each superclass defines, since that code will not appear in the source file of each subclass. Inheritance

Polymorphism

It allows you to have the same name for a method, but it acts differently based on the class that has that method defined.

For example: Animal is a superclass with the speak method and Dog, Cat and Pig are Subclasses of Animal but each one of them speak differently, a Dog barks, a Cat meows and a Pig Oinks which means you have to redefine the speak method for each class depending on how they comunicate.

So Polymorphism is saying that it has the same method name (speak) but the actions that are performed are dependent on the class.

Polymorphism Lynda video

 

Gilberto Rogel García

Special thanks to Luis Vargas, this wouldnt have been done without your help.

WSQ04 – Flipped Learning / #AbolishGrades

2 min read

Well this isn't a new concept for me because i've already been to Ken's flipped classroom which was a not so good experience at the beggining but i got used to it and now i think it's a better way to learn because it encourages students to learn, to look for information by themselves and not to just listen to a teacher say random stuff for an hour and a half and start going crazy because you didn't even got time to write down all that random stuff. Instead of stressing out because of all that information you couldn't process in a normal class, in a flipped classroom you already know what to do, what are you supposed to do and work on it during the class or during whatever time and to do so you must investigate, read, etc before every class and you don't have someone behind you yelling at you what you must do, you just do it because you want to, because you want to learn.

Beneficios:

  • Permite a los docentes dedicar más tiempo a la atención a la diversidad.
  • Es una oportunidad para que el profesorado pueda compartir información y conocimiento entre sí, con el alumnado, las familias y la comunidad.
  • Proporciona al alumnado la posibilidad de volver a acceder a los mejores contenidos generados o facilitados por sus profesores.
  • Crea un ambiente de aprendizaje colaborativo en el aula.
  • Involucra a las familias desde el inicio del proceso de aprendizaje.

Obtenido de:What is innovacion educativa

Gilberto Rogel García

A01630171

WSQ03 – Object-Oriented Basics

1 min read

What do i think about Object Oriented Programming?                                                                                   

I think that it is way more complex than structured programming but at the same time it can be more useful depending on what are you working on.

It makes development and maintenance easier where as in Procedure-roiented programming language it is not easy to manage if code grows as project size grows. Provides data hiding which cant be done in Procedure-oriented programming language.An OOP language can simulate real world events much more effectively.

 

Java Object Oriented Programming Concepts: Concepts

 

Gilberto Rogel García

A01630171

WSQ02 – Hello World

1 min read

Hello world in Java:

Code for you to copy and paste if you're too lazy to write it yourself :) ..

public class HelloWorld {

public static void main(String[] args){

System.out.println("Hello World");

}

}

Synchronizing your Eclipse project with Github guide: Guide

EGit Download: EGit

Gilberto Rogel García

A01630171

WSQ01 – Get Coding

1 min read

For this WSQ i had to install Eclipse, which is a great tool for java development.

This is where i downloaded Eclipse, also this site explains step by step on how to do so: Download Eclipse.

This is how it should look like when you run it.

Gilberto Rogel García

A01630171 

 

WSQ07 Babylonian Method

1 min read

Code: Babylonian Method

Of course i didn't know what the babylonian method was until i watched this video that explained it and helped me make a method for my code: Useful video

After making the babylonian method i made 3 conditions in the main part, one for when the number the user gives you is 0(p==0), another for when the number is negative p>0 and another one for when it is a positive number(p>0).

So if the number is 0 eclipse will display 0, because the square root of 0 is 0 duh..

If the number is less than 0 or negative, eclipse will display "Error", because there is no square roots of negative numbers.

Finally if the number is higher than 0 or postive, eclipse will use the method i made to execute the babylonian method and display the square root of that number.

Gilberto Rogel García A01630171

 

WSQ06 – Greatest Common Divisor

1 min read

For this WSQ i had to find the greatest common divisor of two numbers using Euclid's algorithm.

I had no idea what Euclid's algorithm was so I did a little research and found this useful video that helped me make the code: Click to watch

Link to the code: Code

At first i had some trouble developing this code so, as you can see, i put a lot of SOP's (System.out.println) in between lines to check better what was going on and after about half an hour i realized what I was missing in my code.

 

To be honest i wasn't able to do this without the help of my good friend Itzel because she explained me the method that I aplied in my code.

Link to Itzel's blog: Itzel's Blog

Picture of my Code:

 

Gilberto Rogel García - a01630171

#WSQ05 FINAL PROJECT

1 min read

ENTRY 1

I'll be working on my final project with Oscar Lopez, Itzel Cordero and Luis Eduardo Vargas.

We were thinking about making some sort of Arcade which has, mainly, 2 videogames: a Tic-Tac-Toe and a Hangman. If we are able to implement these 2 videogames withouth trouble, we will try and add one or two more games (Ping-Pong) but we will focus on Hangman and Tic-Tac-Toe.

ENTRY 2

As of right now we've working on the main menu of our arcade game, and we think the menu is done, we now need to make both arcade games and link them to the main menu.

Main:  GitHub

Menu: GitHub

 

Gilberto Rogel García A01630171