I. TITLE: Program 3
II. OBJECTIVES
III. MATERIALS
3.1. One PC with with Java and Java Development Kit (JDK) installed.
IV. THEORY
background apps (mini apps). It is the most used programming language used in
android smartphones and is among the most favored for edge device and internet of
things development.
application that are available in all windows OS. This built in app is used to execute
different commands in order for the other apps to work or sometimes used in
V. PROCEDURES
5.1. Program 3A
5.1.1. Install the Java Development Kit (JDK). The Java program is already
5.1.2. Make a program that will add, subtract, multiply and divide two
5.1.3. In this case, the basic Java program (Hello world type) will not work.
“import java.util.Scanner;
using the line “import.java.util.Scanner;” and then the class file and
the string.
Page 1 of 9
DOROIN
5.1.4. After setting the data values, we have to type the codes below:
a = in.nextFloat();
b = in.nextFloat();
CMD later.
Figure 5.1.4 Making a program that will let you use the basic arithmetic operation
5.1.5. Save it as a java file with a file name same with the class name made
the desktop.
5.1.6. After saving it, you may now use the Command Prompt (CMD) in
Page 2 of 9
DOROIN
5.1.7. Look for the path of the bin that can be found in the drive C > Program
5.1.8. After finding the bin, you can copy the path and paste it to CMD with
5.1.9. Specify the location of your Java file that you made a while ago. Since
5.1.10. In order for you to run the java file and convert it to class file, type
“javac (filename).java”.
Page 3 of 9
DOROIN
5.1.11. When there is no error in your program, Type “java (filename) in
order for your file to pop up in the CMD. It should be shown just like
5.2. Program 3B
5.2.2. Make a program that allows user to input grade for prelims, midterm,
5.2.3. In this case, the basic Java program (Hello world type) will not work.
“import java.util.Scanner;
using the line “import.java.util.Scanner;” and then the class file and
the string.
5.2.4. After setting the data values, we have to type the codes below:
float a = 0;
Page 4 of 9
DOROIN
float b = 0;
float c = 0;
float d = 0;
float e = 0;
float f = 0;
Rigid Body");
a = in.nextFloat();
b = in.nextFloat();
Float g = (a+b)/2;
c = in.nextFloat();
d = in.nextFloat();
Float h = (c+d)/2;
e = in.nextFloat ();
f = in.nextFloat ();
Page 5 of 9
DOROIN
Float i = (e+f)/2;
Float j = (g+h+i)/3;
CMD later.
Figure 5.2.4 Making a program that will let you compute the grades per term and the final grade
5.2.5. Save it as a java file with a file name same with the class name made
the desktop
5.2.6. After saving it, you may now use the Command Prompt (CMD) in
Page 6 of 9
DOROIN
5.2.7. Look for the path of the bin that can be found in the drive C > Program
5.2.8. After finding the bin, you can copy the path and paste it to CMD with
5.2.9. Specify the location of your Java file that you made a while ago. Since
5.2.10. In order for you to run the java file and convert it to class file, type
“javac (filename).java”.
Page 7 of 9
DOROIN
5.2.11. When there is no error in your program, Type “java (filename) in
order for your file to pop up in the CMD. It should be shown just like
Basic Java programming is simple as long as we know the basic commands that
application but there is limitation in some ways. I found it interesting because I can
make a simple programming that can be run through CMD. We can also make a
program that can assign different formulas and let the user input the values using the
scanner. It will be useful in some ways. But today, knowing that we are already
V. CONCLUSION
programming world. Java will introduce us to the wider and broader world of
VI. REFERENCE
Page 8 of 9
DOROIN
6.1. Internet Sites
https://www.lifewire.com/command-prompt-2625840
http://www.theserverside.com/definition/Java
Page 9 of 9