Skip to content

Instantly share code, notes, and snippets.

import java.io.*;
import java.net.*;
public class Client{
public static void main(String[] args) {
String hostname = "localhost";
int port = 5555;
Socket clientSocket = null;
@NusZzz
NusZzz / GPACompute
Created July 16, 2012 19:32
Compute GPA From grade entered from user.
import java.util.Scanner;
public class GPACompute {
public static void main(String[] args) {
String[] course={"LT","ARW","Discrete","PBM","OM","ACP","ST2"};
String[] input = new String[7];
int[] credit = {2,3,3,3,2,3,3};
System.out.println("-----GPA Calculation-----");
Scanner kb = new Scanner(System.in);
@NusZzz
NusZzz / gist:8116808
Created December 24, 2013 18:59
Algorithm for finding maximum value in array java by using Brute Force
public class FindMax {
public static void main(String[] args) {
int[] array = new int[]{3,7,4,9,5,6,8,1,20,2};
int currentMax = array[0];
for(int i=1;i<=array.length-1;i++){
if(currentMax < array[i]){
currentMax = array[i];