Skip to content

Commit 2f6972f

Browse files
committed
update to .java
1 parent a43f284 commit 2f6972f

39 files changed

+101
-115
lines changed

.gitignore

-23
This file was deleted.

dsaproject.txt renamed to DSAProject.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* To change this template file, choose Tools | Templates
44
* and open the template in the editor.
55
*/
6-
package dsaproject;
7-
86
/**
97
*
108
* @author Zairyl Zafra
@@ -16,8 +14,10 @@ public class DSAProject {
1614
/**
1715
* @param args the command line arguments
1816
*/
17+
18+
static Scanner input = new Scanner(System.in);
19+
1920
public static void main(String[] args) {
20-
Scanner input = new Scanner(System.in);
2121
boolean courseMenu = true;
2222
do {
2323
System.out.println();

binarysearchtree.txt renamed to IterativeBinarySearch.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import java.util.Arrays;
2-
import java.util.Scanner;
32
/**
43
* Java program to implement Binary Search. We have implemented Iterative
54
* version of Binary Search Algorithm in Java
@@ -26,9 +25,9 @@ public static void main(String args[]) {
2625
binarySearch(list, 1333);
2726
// Using Core Java API and Collection framework
2827
// Precondition to the Arrays.binarySearch
29-
Arrays.sort(list);
28+
Arrays.sort(list);
3029
// Search an element
31-
int index = Arrays.binarySearch(list, 3);
30+
int index = Arrays.binarySearch(list, 3);
3231
}
3332
/**
3433
* Perform a binary Search in Sorted Array in Java

tree.txt renamed to TreeIterativeBinarySearch.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import java.util.Arrays;
2-
import java.util.Scanner;
32

43
/**
54
* Java program to implement Binary Search. We have implemented Iterative
65
* version of Binary Search Algorithm in Java
76
* @author Javin Paul
87
*/
98

10-
public class IterativeBinarySearch {
9+
public class TreeIterativeBinarySearch {
1110
public static void main(String args[]) {
1211
int[] list = new int[]{23, 43, 31, 12};
1312
int number = 12;

averagemethod.txt renamed to averagemethod.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.Scanner;
2-
public class averageMethod {
2+
public class averagemethod {
3+
static Scanner s = new Scanner(System.in);
34
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
55
double total = 0;
66
int num1, num2, num3, num4, num5;
77
System.out.print("Enter a first number: ");
@@ -23,4 +23,5 @@ public static double average(int num1, int num2, int num3,
2323
total = (num1 + num2 + num3 + num4 + num5) / 5;
2424
return total;
2525
}
26+
2627
}

binarysearch.txt renamed to binarySearch.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import java.util.Scanner;
44

55
public class binarySearch {
6-
6+
static Scanner s = new Scanner(System.in);
77
public static void main(String[] args) {
8-
Scanner s = new Scanner(System.in);
98

109
System.out.println("Enter a series of number: ");
1110
int num = s.nextInt();

consonantvowel.txt renamed to consonantVowel.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import java.util.Scanner;
22
public class consonantVowel{
3-
3+
static Scanner s = new Scanner(System.in);
44
public static void main(String[] args) {
5-
Scanner s = new Scanner(System.in);
65

76
System.out.print("Enter a string: ");
87
String str = s.next();

countcharword.txt renamed to countCharWord.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
22
public class countCharWord {
3+
static Scanner s = new Scanner(System.in);
34
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
5+
56
String str;
67

78
System.out.print("Enter a String : ");

dowhile1.txt renamed to doWhile1.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public class doWhile {
1+
public class doWhile1 {
22
public static void main(String[] args) {
33

44
int i=10;

dowhile2.txt renamed to dowhile2.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ public class Practice2 {
22
public static void main(String[] args) {
33
int i = 1;
44
do{
5-
System.out.print("Juan");
6-
System.out.println(i);
7-
i+=2;
5+
System.out.print("Juan");
6+
System.out.println(i);
7+
i+=2;
88
}while(i<= 5);
99
}
1010

dowhile3.txt renamed to dowhile3.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
2-
public class Practice2 {
2+
public class dowhile3 {
3+
static Scanner s= new Scanner(System.in);
4+
35
public static void main(String[] args) {
4-
Scanner s= new Scanner(System.in);
56

67
int number;
78
String name;
+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import java.util.Scanner;
2-
public class Practice2 {
2+
public class dowhile4 {
3+
4+
static Scanner s= new Scanner(System.in);
5+
36
public static void main(String[] args) {
4-
Scanner s= new Scanner(System.in);
57

68
int number;
79
String name;
@@ -14,9 +16,9 @@ public static void main(String[] args) {
1416
name=s.nextLine();
1517

1618
do{
17-
System.out.println(name);
18-
i++;
19-
}while(i <= number);
19+
System.out.println(name);
20+
i++;
21+
}while(i <= number);
2022

2123
}
2224
}

dsamidterm1.txt renamed to dsamidterm.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import java.util.*;
2-
public class Practice7 {
2+
public class dsamidterm {
3+
static Scanner input = new Scanner(System.in);
34

45
public static void main(String[] args) {
5-
Scanner input = new Scanner(System.in);
66
boolean menu = false;
77
do {
88
System.out.println("Welcome to MIDTERM Practical Exam, please choose a lesson to start an exercise: ");

dsamidterm.txt renamed to dsamidterm1.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.*;
2-
public class JavaApplication1 {
2+
public class dsamidterm1 {
3+
static Scanner input = new Scanner(System.in);
34
public static void main(String[] args) {
4-
Scanner input = new Scanner(System.in);
55
boolean menu = false;
66
do {
77
System.out.println("Welcome to MIDTERM Practical Exam, please choose a lesson to start an exercise: ");
File renamed without changes.

dsaproject1.txt renamed to dsaproject1.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @author raymart
66
*/
7-
public class JavaApplication91 {
7+
public class dsaproject1 {
88

99
public static Scanner s = new Scanner(System.in);
1010
public static Scanner sc = new Scanner(System.in);

arrayexamscore.txt renamed to examScore.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import java.util.Scanner;
22
import java.util.Arrays;
33
public class examScore {
4-
public static void main(String[] args) {
5-
Scanner s = new Scanner(System.in);
4+
static Scanner s = new Scanner(System.in);
5+
6+
public static void main(String[] args) {
67

78
int examScore[] = new int[5];
89

factorialmethod.txt renamed to factorialMethod.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
22
public class factorialMethod {
3+
static Scanner s = new Scanner(System.in);
4+
35
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
56

67
int num1;
78
System.out.print("Enter a Number to Factorial: ");

forloop.txt renamed to forloop.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import java.util.Scanner;
2-
public class forLoop {
2+
public class forloop {
3+
static Scanner s = new Scanner(System.in);
4+
35
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
56

67
int number = 0;
78
String name;
89

910
System.out.print("Enter a Number: ");
1011
number=s.nextInt();
11-
s.nextLine();
12+
s.nextLine();
1213
System.out.print("Enter a Name: ");
1314
name=s.nextLine();
14-
1515
System.out.print("Output:");
1616
for (int i = 1; i <= number; i++) {
1717
System.out.println(name);
File renamed without changes.
File renamed without changes.

ifelse.txt renamed to ifelse.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
2-
public class ifElse {
2+
public class ifelse {
3+
4+
static Scanner s = new Scanner(System.in);
35
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
56
float num1, num2;
67
double total;
78
char operator;
@@ -12,9 +13,9 @@ public static void main(String[] args) {
1213
num2 = s.nextFloat();
1314
System.out.println("Enter the Operator: + , - , + , / ");
1415
System.out.println("");
15-
16+
1617
total = num1 + num2;
17-
operator = in.next().charAt(0);
18+
operator = s.next().charAt(0);
1819

1920
if (operator == '+'|| operator == '-' || operator == '*'
2021
|| operator == '/') {

ifelseif.txt renamed to ifelseif.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
2-
public class ifElseIf {
2+
public class ifelseif {
3+
4+
static Scanner s = new Scanner(System.in);
35
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
56

67
float num1, num2;
78
double total;
File renamed without changes.

mathoperations.txt renamed to mathoperations.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.Scanner;
2-
public class mathOperations {
2+
public class mathoperations {
3+
static Scanner s = new Scanner(System.in);
34
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
55

66
double total = 0;
77
int num1;

multidimentionalarray.txt renamed to multidimentionalarray.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public class multiDimensionalArray{
1+
public class multidimensionalarray{
22
public static void main(String[] args) {
33
int firstarray[][] = {{83, 61, 51}, {51, 31, 21, 31, 41}, {31, 41, 51, 61}};
44
int secondarray[][] = {{31, 15, 41}, {31, 41, 51, 61, 41}, {22}};

mylistarray.txt renamed to mylistarray.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.Scanner;
2-
public class myListArray {
3-
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
2+
public class mylistarray {
3+
static Scanner s = new Scanner(System.in);
4+
public static void main(String[] args) {
55

66
String name[] = new String[3];
77
int age[] = new int[3];

nodupconsonantvowel.txt renamed to nodupConsonantVowels.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.Scanner;
2-
public class noDupConsonantVowels{
2+
public class nodupConsonantVowels{
3+
static Scanner s = new Scanner(System.in);
34
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
55

66
String str;
77
System.out.print("Enter a string: ");

oddevenarray.txt renamed to oddEven.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import java.util.Scanner;
22
public class oddEven {
3-
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
5-
3+
static Scanner s = new Scanner(System.in);
4+
public static void main(String[] args) {
5+
66
int num[] = new int[6];
77
int sum = 0;
88

@@ -13,7 +13,7 @@ public static void main(String[] args) {
1313
for (int i = 1; i < num.length; i++) {
1414
sum = sum + num[i];
1515
}
16-
System.out.println("The total of all number is :"+ sum);
16+
System.out.println("The total of all number is :"+ sum);
1717
for (int i = 1; i < 2; i++) {
1818
if (sum == 0) {
1919

activityarray.txt renamed to operator.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
22
public class operator {
3-
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
3+
static Scanner scanner = new Scanner(System.in);
4+
public static void main(String[] args) {
5+
56

67
//write a java program that determine the ff.
78
// 1. average of all number
@@ -15,7 +16,7 @@ public static void main(String[] args) {
1516
double product = 0, product1=0;
1617
for (int i = 1; i < num.length; i++) {
1718
System.out.print("Enter number " + i + ": ");
18-
num[i] = s.nextInt();
19+
num[i] = scanner.nextInt();
1920

2021
}
2122

@@ -45,7 +46,7 @@ public static void main(String[] args) {
4546
}
4647
}
4748
for (int i = 1; i < 6; i++) {
48-
sum1 += num[i];
49+
sum1 += num[i];
4950
}
5051

5152
System.out.print("The sum of 5 number is : " + sum1);

operator.txt renamed to operator2.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import java.util.Scanner;
2-
public class operator {
3-
public static void main(String[] args) {
4-
Scanner s = new Scanner(System.in);
2+
public class operator2 {
3+
static Scanner s = new Scanner(System.in);
4+
public static void main(String[] args) {
5+
56

67
float num1, num2;
78
double add,sbt,mul,div;
@@ -31,6 +32,6 @@ public static void main(String[] args) {
3132
System.out.println(num1+" "+" /"+" "+num2+" = "+" "+ div);
3233
}else {
3334
System.out.println("Sorry Wrong input! Please Try Again!");
34-
}
35+
}
3536
}
3637
}

0 commit comments

Comments
 (0)