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 void locateAndRefundTicket(int ticketID) { | |
Database database = new Database(); | |
System.out.println(this.ticketHandler.getSoldTicketsList().size()); | |
List<Ticket> ticketsToBeRemoved = new ArrayList<>(); | |
for (Ticket ticket : this.ticketHandler.getSoldTicketsList()) { | |
if (ticket.getTicketID() == ticketID) { | |
ticket.setIsRefunded(true); |
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.*; | |
public class MinOccurance2 { | |
public static void main (String[] args) throws IOException { | |
int[] occur = new int[256]; | |
int current = 0; | |
RandomAccessFile file = new RandomAccessFile("test.txt", "r"); | |
long length = file.length(); |
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
package FileWriter; | |
import java.io.PrintStream; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
import java.util.Random; | |
public class FileWriter { |
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
package practical2p3.uk.ac.qub; | |
public class CaesarCypher { | |
private String stringToEncode; | |
private int codeKey; | |
public CaesarCypher(){ | |
} |
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
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); |
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
package uk.ac.qub.databases; | |
// 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; |
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
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 |