Object Oriented Programming Assignment
Object Oriented Programming Assignment
2100962
BSIT 2B
Assignment
Directions: Answer the given question being asked. Look in the internet or Read books that might help
you answer the questions.
Machine Language: is easier for the computer to understand but harder for the programmer to
understand. This is because machine language is simply the language of machines—bits.
Assembly Language: is slightly easier to understand. The bits of machine language are replaced
by numbers and English commands. Before assembly code is run by the computer, it is
assembled by an assembler.
High-level Language: use many more English commands and are significantly more readable than
assembly or machine language. Many high-level languages have built-in commands that help the
programmer write loops, create variables of different data types, and manipulate strings.
Machine Language: Fortran, binary digits (0s and 1s) and hexadecimal.
A Java method is a collection of statements that are grouped together to perform an operation.
When you call the System.out.println() method, for example, the system actually executes several
statements in order to display a message on the console.
User-defined Methods: We can create our own method based on our requirements.
Standard Library Methods: These are built-in methods in Java that are available to use.
desktop and mobile applications, big data processing, embedded systems, and so on.
According to Oracle, the company that owns Java, Java runs on 3 billion devices
worldwide, which makes Java one of the most popular programming languages.
1. List all the control structure and differentiate each control structure. Answer at least 1
If-else - Use else to specify a block of code to be executed, if the same condition is false.
If- else if / nested if - Use else if to specify a new condition to test, if the first condition is false.
switch statements - Use switch to specify many alternative blocks of code to be executed.
for loop - The initialization expression is declared outside the header and in some it is declared
inside the for header.
while loop - The while loop allows us to specify that a certain statement is to be executed
do – while - Initialization of the control variable, is declared outside the loop header, the
increment/decrement is written within the body of the loop like any other statements.
breaks and continue - Break causes immediate exit from any loop and continue used in a loop,
this statement causes the current loop iteration to end, but the loop then moves on to the next
step.
infinite loops - Is a piece of coding that lacks a functional exit so that it repeats indefinitely.
The methods that I’ve learned in previous Java Programming 2 are Java Pre-Defined Classes that
includes String class, StringBuffer, Vector, Thread, ServerSocket and others. Java Pre-Defined
Classes includes Java Standard Edition in its package. These are the base classes that may be
used or extend while creating an application. The other one is Java.lang package, the most
important classes are Object, which serves as the foundation of the class hierarchy, and class,
whose instances serve as run-time that represent of classes. And also I’ve learned about Java
Classes that means a blueprint for the object.
3. By creating simple code using method how do we use methods in java, give example as coded and
show the result. You must include the explanation of your code.
DIRECTIONS SOURCES:
https://study.com/learn/lesson/programming-language-types-examples.html#:~:text=There%20are
%20three%20main%20kinds,High%2Dlevel%20language
https://www.tutorialspoint.com/java/java_methods.htm#:~:text=A%20Java%20method%20is
%20a,a%20message%20on%20the%20console.
https://www.programiz.com/java-programming/methods
https://www.computerhope.com/jargon/a/al.htm#:~:text=Programs%20written%20in%20high
%2Dlevel,JavaScript%2C%20Clojure%2C%20and%20Lisp.
https://www.bbc.co.uk/bitesize/guides/z4cck2p/revision/1
https://www.indeed.com/career-advice/career-development/types-of-programming-
languages#:~:text=Machine%20languages%20are%20made%20up,a%20machine%20language
%20is%20Fortran.