1. Here are my observations on your Assignment 1,
especially those students who did not get 10 points.
1. Some of your programs contain SYNTAX errors. That is why you are
advised to test first the program before writing it on bond paper.
2. Do not write the program in all CAPITAL LETTERS.
3. Write the program on bond paper, the way it looks and written in
the JVdroid app.
4. You submit one program only.
5. Follow the instructions.
2. Learnings
System.out.println – prints or displays
string in a Java program.
A java statement is ended with a semi -
colon (;).
A java program follows a syntax.
3. Syntax
When referring to a programming language, the syntax is
a set of rules for grammar and spelling. In other words, it
means using character structures that a computer can
interpret. For example, if a user tries to execute a
command without proper syntax, the compiler finds this
error and generates a syntax error, usually causing the
program to fail.
4. Java Programming
Java
• a high-level programming language.
• Was created in 1991 by James Gosling et al. of Sun Microsystems.
• Initially called Oak, in honor of the tree outside Gosling's window, its
name was changed to Java because there was already a language
called Oak.
5. Programming
Programming is the process of creating a set of
instructions that tell a computer how to perform a
task. Programming can be done using a variety of
computer programming languages, such as Java,
JavaScript, Python, C++ and etc.
Programming is not only displaying strings but can also
perform computations or calculations.
6. Programming involves calculations such as
addition, subtraction, multiplication, division and
many more.
Symbols
+ addition
- subtraction
* multiplication
/ division
7. Example
1. Create a program that displays the sum of two
numbers. The number 1 is 10 and number 2 is 5.
2. Create a program that displays the product of
three numbers. The number 1 is 10, number 2 is 7
and number 3 is 2.25. Make use of the data type
double instead of int.
8.
9. DATA TYPES
1. int – can be used in whole numbers. Example ,1 , 154, -56.
2. double – can be used in both in whole and decimal numbers.
Example 2.25, 1.1416, -3, 1.
10. Programming Exercises
Instructions: Write your programs on the bond paper and take a picture. Take
also a picture of yourself showing your answers. Send the four pictures in your
classroom.
1. Create a program that displays the quotient and average of two numbers.
The first number is 12 and the second is 13.
2. A customer enters a shopping mall and purchases 3 items. The first item is
a stapler that costs 165.75 and the second one is a bond paper that costs
513.50. The third item is a notebook that costs 56.00. What is the total cost
of the three items?
3. What is the area of a circle if the radius is 5?