This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Vector; | |
public class Valid { | |
/* | |
* This user-defined class is made by James Carlo Luchavez. | |
* This class is composed of the following Data Validating Methods: | |
* (a) "isDuplicate" returns the index of the given data from the array - Vector, ArrayList, Normal Array | |
* (b) "removeExcessSpace" returns a lowercase string with only one space from each word or element | |
* (c) "firstLetterUp" returns a string with first letters of each word capitalized (for names) | |
* (d) "toInteger" converts a string value to integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JFrame; | |
public class MyFirstJFrame extends JFrame { | |
public MyFirstJFrame() { | |
/* | |
* There are two ways to set the Windows title of the JFrame | |
* One is by passing a string to the "super constructor". | |
* The other one is using the "setTitle" method. | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.GridLayout; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.JTextField; | |
import javax.swing.SwingConstants; | |
public class GUISum extends JFrame{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.GridLayout; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.JTextField; | |
import javax.swing.SwingConstants; | |
public class ArithmeticOperations extends JFrame { | |
/* | |
* Only 3 Swing Components are required in this activity namely: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SMS | |
{ | |
private String inbox[]; | |
private int smsCount, capacity, balance; | |
SMS(){ | |
capacity = 10; | |
inbox = new String[capacity]; | |
smsCount = 0; | |
} | |
SMS(int capacity){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
import javax.swing.JOptionPane; | |
import javax.swing.JTextArea; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class BowlingGame { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Program: BOWLING SCOREBOARD\n"); | |
int score, total1 = 0, total2 = 0; | |
try{ | |
System.out.println("\nFirst Try\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class EvenNum { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner (System.in); | |
System.out.println("Program: EVEN NUMBERS FROM 1-50\n"); | |
System.out.println("Even Number from 1 to 50..."); | |
System.out.println("----------using for loop----------"); | |
for(int i = 1; i<=50; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class numberManipulation { | |
static String DecToBinary(int num) { | |
if(num <= 0) return ""+num; | |
String hold = ""; | |
while(num!=0) { | |
hold = (num%2)+hold; | |
num/=2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Vector; | |
public class Magic { | |
// DUPLICATE CHECKERS | |
static boolean isDuplicate(String s, Vector<String> arr) { // String Array | |
for(String x: arr) { | |
if(x.equalsIgnoreCase(s)) { | |
return true; | |
} |
OlderNewer