Skip to content

Instantly share code, notes, and snippets.

public class mummy{
double height, width;
int age;
String name;
public Mummy(){
}
public double getHeight(){
@JorgeOlvera
JorgeOlvera / Author.java
Created April 3, 2014 05:25
Author and Book classes, with their respective testing programs
//COMPILES!!!!!
/*public getters/setters: getName(), getEmail(), setEmail(), and getGender();
(There are no setters for name and gender, as these attributes cannot be changed.)
A toString() method that returns "author-name (gender) at email", e.g., "Tan Ah Teck (m) at [email protected]".*/
public class Author{
private String name;
private String email;
private char gender;
public Author (String name, String email, char gender){
import java.io.*;
import java.util.*;
public class RandomIntegerData {
public static void main(String [] args) throws IOException {
Scanner input = new Scanner(System.in);
Random randomnum = new Random();
System.out.println("Enter highest value ");
public class reading
@JorgeOlvera
JorgeOlvera / clientsApp.java
Last active August 29, 2015 14:00
Clients App
import java.io.*;
import java.util.*;
public class clientsApp{
public static void main(String [] args) throws IOException{
try{
Scanner file = new Scanner(new File("clients.txt"));
PrintWriter outputFileM = new PrintWriter(
new BufferedWriter(
@JorgeOlvera
JorgeOlvera / readFiles.java
Last active August 29, 2015 14:00
The App2
import java.util.*;
import java.io.*;
public class readFiles{
public static void main(String[] args) throws IOException{
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int b = input.nextInt();
int[][] array = new int[a][b];
@JorgeOlvera
JorgeOlvera / Student.java
Last active August 29, 2015 14:00
3RD PARTIAL LAB
import java.io.*;
import java.util.*;
public class studentClass{
private String id, name;
private double gpa;
private int coursesTaken;
public Student(String id, String name, double gpa, int coursesTaken){
import java.util.Scanner;
public class reverseWriter {
public static void main (String args[]){
String[] fileContents;
String[] reversedContents;
int count = 1;
import java.util.Scanner;
import java.io.*;
public class countingLines {
public static void main(String [] args) {
try {
//Scans file
Scanner input = new Scanner(System.in);
Scanner file = new Scanner(new File(text2.txt));
import java.util.Scanner;
import java.io.*;
public class flipLines {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
Scanner file = new Scanner(new File(toFlip.txt));