Skip to content
Snippets Groups Projects
Commit 44ad41a0 authored by Joel Andrew Wach's avatar Joel Andrew Wach
Browse files

test

parent ba30d217
Branches
Tags
No related merge requests found
Showing
with 678 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Assignment2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
File added
File added
File added
File added
File added
File added
File added
package assignment2;
public class Customer {
private String customerCode;
private String type;
private String primaryContact;
private String name;
private String address;
Customer(String customerCode, String type, String primaryContact, String name,String address){
this.setCustomerCode(customerCode);
this.setType(type);
this.setPrimaryContact(primaryContact);
this.setName(name);
this.setAddress(address);
}
public String getCustomerCode() {
return customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getPrimaryContact() {
return primaryContact;
}
public void setPrimaryContact(String primaryContact) {
this.primaryContact = primaryContact;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
/*public void readCustomer (){
String fileName = "data/Customer.dat";
Scanner s = null;
try {
s = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String customer = "";
while(s.hasNext()) {
customer += s.next().trim();
}
s.close();
String[] parts = customer.split(";");
String customerCode = parts[0];
String type = parts[1];
String primaryContact = parts[2]; //this corresponds to a person in the person class.
String name = parts[3];
String address = parts[4];
}
*/
package assignment2;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class DataConvereter {
public void readPerson (){
String fileName = "data/Person.dat";
Scanner s = null;
try {
s = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
int size =Integer.parseInt(s.nextLine());
for(int i=0;i<size;i++){
String personTemp = s.nextLine();
String[] parts = personTemp.split(";");
String personCode = parts[0];
String name = parts[1];
String address = parts[2];
String eMail = parts[3];
Person p = new Person(personCode,name,address,eMail);
/*p.setPersonCode(personCode);
p.setName(name);
p.setAddress(address);
p.seteMail(eMail);*/
}
s.close();
}
public void readVenues (){
String fileName = "data/Venues.dat";
Scanner s = null;
try {
s = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
int size =Integer.parseInt(s.nextLine());
for(int i=0;i<size;i++){
String venueTemp = s.nextLine();
String[] parts = venueTemp.split(";");
String venueCode = parts[0];
String name = parts[1];
String address = parts[2];
int capacity = Integer.parseInt(parts[3]);
Venues v = new Venues(venueCode,name,address,capacity);
/*v.setVenueCode(venueCode);
v.setName(name);
v.setAddress(address);
v.setCapacity(capacity);*/
}
s.close();
}
public void readCustomer (){
String fileName = "data/Customers.dat";
Scanner s = null;
try {
s = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
int size =Integer.parseInt(s.nextLine());
for(int i=0;i<size;i++){
String customerTemp = s.nextLine();
String[] parts = customerTemp.split(";");
String customerCode = parts[0];
String type = parts[1];
String primaryContact = parts[2];
String name = parts[3];
String address = parts[4];
Customer c = new Customer(customerCode,type, primaryContact, name, address);
/*c.setCustomerCode(customerCode);
c.setType(type);
c.setPrimaryContact(primaryContact);
c.setName(name);
c.setAddress(address);*/
}
s.close();
}
}
package assignment2;
public class GameTicket {
private String code;
private String TG;
private String venueCode;
private String dateTime;
private String team1;
private String team2;
private double pricePerUnit;
GameTicket(String code, String TG, String venueCode, String dateTime, String team1, String team2, double pricePerUnit){
this.code = code;
this.TG = TG;
this.venueCode = venueCode;
this.dateTime = dateTime;
this.team1 = team1;
this.team2 = team2;
this.pricePerUnit = pricePerUnit;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getTG() {
return TG;
}
public void setTG(String TG) {
this.TG = TG;
}
public String getVenueCode() {
return venueCode;
}
public void setVenueCode(String venueCode) {
this.venueCode = venueCode;
}
public String getDateTime() {
return dateTime;
}
public void setDateTime(String dateTime) {
this.dateTime = dateTime;
}
public String getTeam1() {
return team1;
}
public void setTeam1(String team1) {
this.team1 = team1;
}
public String getTeam2() {
return team2;
}
public void setTeam2(String team2) {
this.team2 = team2;
}
public double getPricePerUnit() {
return pricePerUnit;
}
public void setPricePerUnit(double pricePerUnit) {
this.pricePerUnit = pricePerUnit;
}
}
package assignment2;
public class PSL {
private String code;
private String SL;
private String ticketCode;
private double licenseFee;
PSL(String code, String SL, String ticketCode, double licenseFee){
this.setCode(code);
this.setSL(SL);
this.setTicketCode(ticketCode);
this.setLicenseFee(licenseFee);
}
public void setLicenseFee(double licenseFee) {
this.licenseFee = licenseFee;
}
public double getLicenseFee() {
return licenseFee;
}
public void setTicketCode(String ticketCode) {
this.ticketCode = ticketCode;
}
public String getTicketCode() {
return ticketCode;
}
public void setSL(String sL) {
SL = sL;
}
public String getSL() {
return SL;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
package assignment2;
public class ParkingPass {
private String code;
private String SP;
private String venueCode;
private double hourlyFee;
ParkingPass(String code, String SP, String venueCode, double hourlyFee){
this.setCode(code);
this.setSP(SP);
this.setVenueCode(venueCode);
this.setHourlyFee(hourlyFee);
}
public void setHourlyFee(double hourlyFee) {
this.hourlyFee = hourlyFee;
}
public double getHourlyFee() {
return hourlyFee;
}
public void setVenueCode(String venueCode) {
this.venueCode = venueCode;
}
public String getVenueCode() {
return venueCode;
}
public void setSP(String sP) {
SP = sP;
}
public String getSP() {
return SP;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
package assignment2;
public class Person {
private String personCode;
private String name;
private String address;
private String eMail;
public Person(String personCode, String name, String address, String eMail) {
this.setPersonCode(personCode);
this.setName(name);
this.setAddress(address);
this.seteMail(eMail);
}
public String getPersonCode() {
return personCode;
}
public void setPersonCode(String personCode) {
this.personCode = personCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String geteMail() {
return eMail;
}
public void seteMail(String eMail) {
this.eMail = eMail;
}
}
package assignment2;
public class Refreshments {
}
package assignment2;
public class SeasonPass {
private String code;
private String TS;
private String team;
private String startDate;
private String endDate;
private double cost;
SeasonPass(String code, String TS, String team, String startDate, String endDate, double cost){
this.code = code;
this.TS = TS;
this.team = team;
this.startDate = startDate;
this.endDate = endDate;
this.cost = cost;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getTS() {
return TS;
}
public void setTS(String tS) {
TS = tS;
}
public String getTeam() {
return team;
}
public void setTeam(String team) {
this.team = team;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public double getCost() {
return cost;
}
public void setCost(double cost) {
this.cost = cost;
}
}
\ No newline at end of file
package assignment2;
public class Venues {
private String venueCode;
private String name;
private String address;
private int capacity;
public Venues(String venueCode, String name, String address, int capacity){
this.setVenueCode(venueCode);
this.setName(name);
this.setAddress(address);
this.setCapacity(capacity);
}
public String getVenueCode() {
return venueCode;
}
public void setVenueCode(String venueCode) {
this.venueCode = venueCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getCapacity() {
return capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
}
/*public void readVenues (){
String fileName = "data/Venues.dat";
Scanner s = null;
try {
s = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String venue = "";
while(s.hasNext()) {
venue += s.next().trim();
}
s.close();
String[] parts = venue.split(";");
String venueCode = parts[0];
String name = parts[1];
String address = parts[2];
String capacity = parts[3];
}*/
\ No newline at end of file
package assignment2;
public class address {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment