Professional Documents
Culture Documents
Week 7 To 9
Week 7 To 9
Week 7 To 9
WEEK 7
Activity 1
ANSWER SHEET
Java Programming
Name: Semense, Maria Nilca P. Activity Title: ______________________________
Grade Level and Section: Grade 12 San Fernando
Activity
Page 1 of 6
SUBJECT (PROGRAMMING) (Quarter/1Week 7 - 9)
Prepared by:(GLENN L. TABUCANON)
Answer: Both “is” and “==” are used for object comparison in Python. The operator “==” compares values
of two objects, while “is” checks if two objects are same (In other words two references to same object).
Page 2 of 6
SUBJECT (PROGRAMMING) (Quarter/1Week 7 - 9)
Prepared by:(GLENN L. TABUCANON)
WEEK 8
Activity 1
ANSWER SHEET
Java Programming
Name: ____________________________________ Activity Title: ______________________________
Grade Level and Section: ____________________
1. What is JVM? Why is Java called the ‘Platform Independent Programming Language’?
Answer: Java is class based and object oriented programming language. This bytecode is sent to Java
virtual machine (JVM) which resides in the RAM of any operating system. JVM recognizes the platform
it is on and converts the bytecodes into native machine code. Hence java is called platform
independent language.
2. What is the Difference between JDK and JRE?
Answer: JDK(Java Development Kit) is used to develop Java applications. JDK also contains
numerous development tools like compilers, debuggers, etc. JRE(Java Runtime Environment) is the
implementation of JVM(Java Virtual Machine) and it is specially designed to execute Java programs.
3. What does the ‘static’ keyword mean?
Answer: In the Java programming language, the keyword static indicates that the particular member
belongs to a type itself, rather than to an instance of that type. This means that only one instance of
that static member is created which is shared across all instances of the class.
4. In order to run Java program, we need to install __________application program.
Answer: To run a java program, we need to install the “Java Development Kit” (JDK) application
program.
5. Previously Java was known as ________.
6. Answer: Oak is a discontinued programming language created by James Gosling in 1989, initially for
Sun Microsystems’ set-top box project. The language later evolved to become Java. The name Oak
was used by Gosling after an oak tree that stood outside his office.
7. Java is a _____________language.
Answer: Java is a popular programming language
8. Java is developed by__________.
Answer: Java was originally developed by James Gosling at Sun
9. What do you mean by JRE?
Answer: JRE (Java Runtime Environment) is an installation package that provides an environment to
only run(not develop) the java program(or application)onto your machine.
10. Java is developed by___________.
Answer: Java was originally developed by James Gosling at Sun
Page 3 of 6
SUBJECT (PROGRAMMING) (Quarter/1Week 7 - 9)
Prepared by:(GLENN L. TABUCANON)
11. What is the following operation(s) is/are required to convert the java source code into output form.
Answer: The java command compiles Java source code into Java bytecodes, stores the resulting
bytecodes in a class file with a name of the form “class name.
12. Is java 100% object oriented language?
Answer: Java is not fully object oriented because it supports primitive data type like it,byte,long etc.
Which are not objects. Because in JAVA we use data types like int, float, double etc. which are not
object oriented, and of course is what opposite of OOP is. That is why JAVA is not 100% objected
oriented.
13. Java _________the program first and then __________it. Answer: A and C
a.) compile
b.) interpret
c.) assemble
d.) debug
14. What is the extension of the Java program?
Answer:
15. They are used to perform operations on variables and values.
Answer: Operators are used to perform operations on variables and values.
Page 4 of 6
SUBJECT (PROGRAMMING) (Quarter/1Week 7 - 9)
Prepared by:(GLENN L. TABUCANON)
WEEK 9
Activity 1
ANSWER SHEET
Java Programming
Name: ____________________________________ Activity Title: ______________________________
Grade Level and Section: ____________________
Write a program form the given problem, but before you write the program show solution by creating a
Flowchart and a Pseudocode.
1. Write a program and showing the flowchart and pseudocode in Java that will ask the user to input three
numbers and then the program will find the total sum of tree numbers given by the user.
Sample output:
======== ADDITION OF THREE NUMBER =========
Enter First Number : 1
Enter Second Number: 2
Enter Third Number: 3
The sum of 1, 2, and 3 is: 6
Solution:
// addition_of_three_numbers.java
// Date: Sept 22, 2021
// Written By: Name of Student
import java. util.Scanner;
class addition_of_three_numbers {
public static void main(String args(]) {
Scanner scan = new Scanner(System.in);
System.out.println();
System.out.println(“======== ADDITION OF THREE NUMBERS =========”);
System.out.println();
System.out.print("Enter First Number : ");
int a = scan.nextlnt();
System.out.print("Enter Second Number :”);
int b = scan.nextlnt();
Page 5 of 6
SUBJECT (PROGRAMMING) (Quarter/1Week 7 - 9)
Prepared by:(GLENN L. TABUCANON)
2. Write a program and showing the flowchart and Pseudocode in Java that will compute the area of the
circle. Use the formula: Area = ? r2 where Pi (?) is approximately to 3.1416
Sample output:
*************** AREA OF THE CIRCLE SOLVER **************
Enter the radius of the circle: 10
The given radius is 10 the area of the circle is 3.1416
3. Write a program and showing the flowchart and Pseudocode in Java that takes the user for a distance
(in meters) and the time was taken (as three numbers: hours, minutes, seconds), and display the
speed, in meters per second, kilometers per hour and miles per hour (hint: 1 mile = 1609 meters).
Test Data
Input distance in meters: 2500
Input hour: 5
Input minutes: 56
Input seconds: 23
Expected Output :
Your speed in meters/second is 0.11691531
Your speed in km/h is 0.42089513
Your speed in miles/h is 0.26158804
Page 6 of 6