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.programming1p1; | |
// Importing scanner for user input | |
import java.util.Scanner; | |
public class DingDongNumberPractical { | |
// Declaring constants which limit user input and control output | |
public static final int MIN_INPUT = 50; | |
public static final int MAX_INPUT = 100; |
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 locateTransactionTickets(int transactionID) { | |
for (Ticket ticket : this.ticketHandler.getSoldTicketsList()) { | |
if (ticket.getTransactionID() == transactionID) { | |
ticket.setIsRefunded(true); | |
refundTransaction(ticket); | |
this.getTicketHandler().getSoldTicketsList().remove(ticket); | |
} | |
} | |
} |
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 gui; | |
import java.awt.BorderLayout; | |
import java.awt.Dimension; | |
import java.awt.GridBagConstraints; | |
import java.awt.GridBagLayout; | |
import java.awt.Insets; | |
import javax.swing.BorderFactory; | |
import javax.swing.JFrame; |
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 gui.alt; | |
import java.awt.GridBagConstraints; | |
import java.awt.GridLayout; | |
import java.text.ParseException; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import javax.swing.JTextArea; |
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 gui.alt; | |
import javax.swing.JFrame; | |
import javax.swing.SwingUtilities; | |
public class App { | |
public static void main(String[] args) { | |
SwingUtilities.invokeLater(new Runnable() { |
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 String getSimpleStartTime(){ | |
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm"); | |
this.simpleStartTime = simpleDateFormat.format(this.getStartTime()); | |
return simpleStartTime; | |
} |
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
/** | |
* Gets the current performance based on system time. | |
* | |
* @param performanceHandler - the Performance handler to be iterated through. | |
* @return currentPerformance - the current performance | |
* @throws ParseException - throws a parse exception (placeholder) | |
*/ | |
public Performance getCurrentPerformance() throws ParseException { | |
// Initialise performance handler and add perfs to list |
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 Date calculateEndTime (Film film) { | |
calendar.setTime(film.getStartTime()); | |
calendar.add(Calendar.MINUTE, film.getRunTimeInMinutes()); | |
return calendar.getTime(); | |
} |
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 test; | |
import static org.junit.Assert.*; | |
import org.junit.Before; | |
import org.junit.Test; | |
import cinema.Film; | |
public class testFilm { |
NewerOlder