Skip to content

Instantly share code, notes, and snippets.

View LordNairu's full-sized avatar

Niall Collins LordNairu

  • Liberty Information Technology
  • Belfast, N. Ireland
View GitHub Profile
@LordNairu
LordNairu / LeapYearCalc.java
Last active December 26, 2015 15:19
Leap year calculator.
package uk.ac.qub.practicals;
// importing scanner
import java.util.Scanner;
public class LeapYearApp {
public final static int CURRENT_YEAR = 2013;
public final static int MINIMUM_YEAR = 1900;
package qub.ac.uk.practical.week5;
// import scanner
import java.util.Scanner;
public class PracticalQuestionTwo {
/**
* A method for calling a case converter method
* @param args
package qub.ac.uk.practical.week5;
// importing scanner
import java.util.Scanner;
public class PracticalQuestionThree {
/**
* @param args
*/
package qub.ac.uk.practical.week5;
public class PracticalFiveQuestionOne {
/**
* Constant rate of pay.
*/
public static final double PAY_RATE = 10.25;
/**
* A method which calculates wages from an array
package qub.ac.uk.practical.week5;
public class PracticalFiveQuestionTwo {
public static void main(String[] args) {
// Declaring vars
double average;
average = 0.0;
@LordNairu
LordNairu / Heights.java
Last active December 28, 2015 15:19
Average, tallest and smallest heights.
package qub.ac.uk.practical.week5;
public class PracticalFiveQuestionThree {
/**
* A method which calculates various statistics of students from an array
* @param args
*/
public static void main(String[] args) {
// Declaring vars to hold average height, tallest and smallest
@LordNairu
LordNairu / JDBC.java
Last active December 29, 2015 13:09
JDBC
package uk.ac.qub.assessedpracticaltwo;
// Importing required SQL functions
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
package practicalonep2.uk.ac.qub;
import java.util.Scanner;
public class Palindrome {
public static void main(String args[]){
String original, reverse="";
Scanner scanner = new Scanner(System.in);
/**
* Calculates the amount of tax to deduct
* from gross monthly pay.
* No tax is taken on the first £375
* 10% is taken on the next £225
* and 23% is taken on what remains
* @param grossPay - An employees gross pay
*/
public void taxCalc(double grossPay) {
package practical2p3.uk.ac.qub;
public class CaesarCypher {
public CaesarCypher(){
}
public CaesarCypher (String stringToEncode, int codeKey) {
this.stringToEncode = stringToEncode;