Wednesday, 23 August 2023

Lesson 6: Simple Program

 

A Java program is executed from the main method in the class.

Let’s begin with a simple Java program that is displays the message welcome to Java! On the console (output).

The word console is an old computer term that refers to the text entry and display device of a computer. 

Console input means to receive input from the keyboard, and console output means to display output on the monitor.


Line 1 - defines a class. Every Java program must have at least one class. Each class has a
name. By convention, class names start with an uppercase letter. In this example, the class
name is Welcome.

Line 2 - defines the main method. The program is executed from the main method. A class
may contain several methods. The main method is the entry point where the program begins execution.

A method is a construct that contains statements. The main method in this program contains the System.out.println statement. This statement displays the string Welcome to Java! On the console (Line 4).

String is a programming term meaning a sequence of characters. A string must be enclosed in double quotation marks. Every statement in Java ends with a semicolon (;), known a the statement terminator.

Reserved words, or keywords, have a specific meaning to the compiler and cannot be used for other purpose in the program.
For example, when a compiler sees the word class, it  understand that the word after class is the name for the class. Other reserved words in this program are public, static, and void.

Line 3 is a comment that documents what the program is and how it is constructed. Comment help programmers to communicate and understand the program. They are not programming language and thus are ignored by the compiler.

In Java, comments are preceded by two slashes ( //) on a line, called a line comment, or enclosed between / * and */ on one or several lines, called a block comment or paragraph comment. When compiler sees //, it ignores all text after // on the same line
The following below are the example of comments:


A pair of curly braces in a program form a block that groups the program’s components. In Java, each block begins with an opening braces ({) and ends with a closing braces (}).

Every classes has a class block that groups the data and methods of the class. Similarly, every method has a method block that groups the statement in the method.

Blocks can be nested, meaning that one block can be placed within another, as shown in the following code below.

`~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~'
You have seen several special characters
(e.g., { }, //, and ;) in the program. They are used in almost every program. The most common errors you will make as you learn to program will be syntax errors.
'~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.'




.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~

Check-Point

_____________________________________________________
   ~o~ End of the lesson ~o~
_____________________________________________________

Thank you!

Thursday, 17 August 2023

Lesson 5: Java Specification


 Good day my dear students!!

    We are almost there... Next week we are going to do the actual coding, so I suggest to study in advance for you to go along with the application next week. You may download the previous lessons from lesson 1 to 6 by clicking the link below and please answer the check-point 4 and 5 for your assignment.

Note: No assignment, No entry in the computer lab.

Download: Lessons 1 to 6 (Click here)πŸ‘ˆπŸ‘ˆ

*** LESSON FIVE (5) ***

**JAVA LANGUAGE SPECIFICATION **

πŸ‘‰ is a technical definition of the Java programming language’s Syntax and semantics.

**JAVA SYNTAX **

πŸ‘‰ is defined in the Java specification

**API**

πŸ‘‰also known as library, contains predefined classes and interfaces for developing Java programs.

**JDK**
πŸ‘‰Java Development Toolkit
Example of Java development toolkit are the following:
NetBeans, Eclipse, and Textpad

**IDE**
πŸ‘‰is defined in the Java API
(Integrated Development Environment)
___________________________________________________________________
Note:
Computer languages have strict rules of usage. If you do not follow the rules when writing a programs, the computer will not be able to understand it.
___________________________________________________________________
Java is a full-fledged and powerful language that can be used in many ways it come in three edition

Java Standard Edition (Java SE) to develop client-side applications. The applications
can run standalone or as applets running from a Web browser.

 Java Enterprise Edition (Java EE) to develop server-side applications, such as Java
servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).

 Java Micro Edition (Java ME) to develop applications for mobile devices, such as
cell phones.


Check-point

Instruction: Read the question carefully and write the correct answer after each and every question. You may use 1/2 sheet of paper this time. Please write your answer neatly and legibly.

1.24 What is Java Language specification?
1.25 What does JDK stand for?
1.26 What is IDE stand for?
1.27 What is Java Syntax?
1.28 Discuss the different version of Java.

_____________________________________________________
   ~o~ End of the lesson ~o~
_____________________________________________________
Thank you and God bless!

Lesson 4: Java, the World Wide Web, and beyond

 





Java has become enormously popular. It is rapid rise and wide acceptance can be traced to its designed characteristics, particularly its promise that you can write a program once and run it anywhere.
As stated by its designer Java is:
SIMPLE
OBJECT ORIENTED
DISTRIBUTED
INTERPRETED
ROBUST
SECURE
ARCHETECTURE NEUTRAL, 
PORTABLE
HIGH PERFORMANCE
MULTI-THREADED; AND DYNAMIC
Java is full-featured, general-purpose programming language that can be used to develop  robust mission-critical applications.
Today, it is employed not only for Web programming but also for developing standalone applications across platforms on servers, desktop computers, and mobile devices.










Instruction: Read the question properly and Write your answer on a 1/2 sheet of paper and submit it next meeting (August 22, 2023).


_____________________________________________________
   ~o~ End of the lesson ~o~
_____________________________________________________
Thank you and God bless you...

Saturday, 12 August 2023

Lesson 3: Operating System

Greetings!

Good day everyone please have time to study because we are going to have a Weekly test on Tuesday (August 14, 2023) I already gave you a hard copy last meeting so that you could study from Lesson 1, 2 and 3 and you may download the ppt below for your convenient. Thank you and see you in my class.

Lesson 3: Operating System

What is an Operating System?
Is the important program that runs on a computer.
The OS manages and control a computer's activity.
Popular operating system for general-purpose computers;
* Windows
* Mac OS
* Linux
Function of OS
* Providing a user interface
* Running application
* Support for built in utility
* Control to the computer hardware
Components of OS
* Process Management
* Memory management
* I/O device management
* Network management
* User interface
Types of OS
* Single user, single task
This type of operating system only has to deal one person at a time,
running one user application at a time.
example: Nokia mobile phone (Symbian), Palm OS- hand held computers.
* Single user, multi-tasking
a. Windows - allows user to perform one or more than one task at a time
-Commonly as; MS windows and Apple Macintosh
-Windows is a series of operating systems developed by Microsoft
each version of windows includes graphical user interface, with desktop that allows users to view files and folder.
b. Android OS now a days is a Single user, multi-tasking because of its multi-tasking features.
c. Macintosh -OS X is version 10 of the Apple Macintosh operating system.
-OS X was described by apple as its first complete revision of the previous version OS 9, with a focus on modularity so that   future changes would be easier to incorporate.
  - Written in C++, C. Objective -C
Operating System interface
* Command line interface
* Graphic user interface
Advantages of OS
* Easy to use
* User friendly
* Intermediate between all hardware's and software of the system.
* No need to know any technical languages
* It’s the platform all programs.
Disadvantages
* If any problems affected in OS, you may lose all the contents which have been stored already
* Unwanted user can use your own system. (Wireless desktop) and computer hacking. 

Check-Point
1. What is an Operating System?
2. What are the 3 prominent operating systems for general-purpose computers?
3. What are the functions of an Operating system.
4. Name the 2 types of OS.
5. Name two (2) Operating system interface.
6. Name the advantage and disadvantages of an operating system.

_____________________________________________________
   ~o~ End of the lesson ~o~
_____________________________________________________

Thank you and God bless!

Saturday, 5 August 2023

Lesson 2: PROGRAM




Please click and download the following links below for your reference and for your 1st performance task. (Please take note for the deadline of submission will be on Tuesday - August 8, 2023 and we're going to have a summative test on the same date.)



_____________________________________________________
   ~o~ End of the lesson ~o~
_____________________________________________________

Thank you and God bless...

Tuesday, 25 July 2023

Exercises - Lesson 1

 

Saint Francis of Assisi School,
Peace Valley, Lahug Cebu City,
Mhuddy T. Dagatan, LPT. (Computer teacher).
Lesson 1
Introduction to Java Programming

Summative test Exercises

1.1. What is hardware and software?
1.2. List five major hardware components of a computer.
1.3 What does the acronym “CPU” stand for?
1.4. What unit is used to measure CPU speed?
1.5. What is a bit? What is a byte?
1.6. What is memory for? What does RAM stand for? Why is memory called RAM?
1.7. What unit is used to measure memory size?
1.8. What unit is used to measure disk size?
1.9. What is the primary difference between memory and a storage device?




Thank you and God bless...