Skip to content

Instantly share code, notes, and snippets.

@AndresRodz
AndresRodz / ListReader.java
Last active August 29, 2015 14:18
Program that reads a list, sorts it in ascending order, and displays the highest, lowest, and average values.
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class ListReader {
public static void main(String[] args) {
String csvFile = "/home/andres/Desktop/Tareas de Java/List.csv";
String line = "";
BufferedReader br = null;
@AndresRodz
AndresRodz / Calculator.java
Created September 17, 2014 02:49
Constructing a calculator using GUI.
/**
* @author Andres Rodriguez
* @version 1.0.0
* @since 16-09-2014
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
@AndresRodz
AndresRodz / Functions.java
Last active August 29, 2015 14:05
Function objects constructors and methods. Html: file:///C:/Users/Andres/Desktop/Tareas%20de%20Java/Functions.html
/**
*@author Andres Rodriguez
*@version 1.0.0
*@since 2014-8-22
*/
import java.util.*;
import java.lang.Math.*;
/**
*@param a
*The value of a that will be introduced by the user to be sent to the other methods to solve the function asked for that changes the height and width of the graph.
@AndresRodz
AndresRodz / Car.java
Created May 5, 2014 08:04
Car class and application
public class Car {
private String brand;
private double pricePerDay;
private int availability;
public Car(String brand, double pricePerDay, int availability) {
this.brand = brand;
this.pricePerDay = pricePerDay;
this.availability = availability;
@AndresRodz
AndresRodz / StudentAppBinary.java
Created May 5, 2014 08:03
Student Application using Binary Files
import java.io.*;
import java.util.*;
public class StudentAppBinary {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner(System.in);
System.out.println("Please introduce the ID: ");
String id = input.nextLine();
System.out.println("Please introduce the name: ");
@AndresRodz
AndresRodz / ReverseOrderFile.java
Created April 24, 2014 04:36
3rd Partial Laboratory
import java.io.*;
import java.util.*;
public class ReverseOrderFile {
public static void main(String [] args) throws IOException {
try {
Scanner myFile = new Scanner(new File("reverse.txt"));
while(myFile.hasNextLine()) {
String line = myFile.nextLine();
String [] words = line.split(" ");
@AndresRodz
AndresRodz / ReadingTextFiles.java
Created April 11, 2014 07:11
Third Partial Laboratory 1 and 2: Random Integer Data
import java.io.*;
import java.util.Scanner;
public class ReadingTextFiles {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner(System.in);
System.out.println("Please introduce which file you wish to read: ");
String fileName = input.next();
@AndresRodz
AndresRodz / Author.java
Created April 3, 2014 03:31
Author and Book Classes and Test Applications
public class Author {
private String name;
private String email;
private char gender;
public Author(String name, String email, char gender) {
this.name = name;
this.email = email;
this.gender = gender;
@AndresRodz
AndresRodz / Date.java
Created March 31, 2014 03:38
Date Class and App
public class Date {
// Instance Variables
public int day;
public int month;
public int year;
// 1st constructor without parameters.
public Date() {
day = 1;
month = 1;
@AndresRodz
AndresRodz / Mummy.java
Created March 26, 2014 04:05
Mummy Class
public class Mummy {
// Instance Variables
Double height;
Double width;
int age;
String name;
public Mummy() {
}