Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Armada, Faith R. ID NO.

2100962

BSIT 2B

ITE 122 - Object Oriented Programming (Lecture)

Assignment

Directions: Answer the given question being asked. Look in the internet or Read books that might help
you answer the questions.

 What are the Programming Languages Types?

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.

 Give at least 3 Examples of Programming Languages of each Types.

Machine Language: Fortran, binary digits (0s and 1s) and hexadecimal.

Assembly Language: Lotus 1-2-3, Turbo Pascal and JavaScript.

High-level Language: C++, C#, and Visual Basic.

 What is Java methods?

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.

 What are the different types of methods in java?

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.

Essay: Review of the previous topic in Java Programming 2.

 Java is a powerful general-purpose programming language. It is used to develop

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

paragraph per control structure. (20 pts.)

If - Use if to specify a block of code to be executed, if a specified condition is true.

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

repetitively until the loop condition is false.

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.

2. Explain the methods you learned previously in Java Programming 2. (20pts)

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.

You might also like