Skip to content
Snippets Groups Projects
Commit 5bcfc9c6 authored by Russell Furnas Kaup's avatar Russell Furnas Kaup
Browse files

Merge branch 'master' of git.unl.edu:cse156-group/homework-2

The address class has been completed
parents 5a669305 123584c0
Branches
No related tags found
No related merge requests found
......@@ -23,11 +23,7 @@ public class DataConvereter {
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);*/
new Person(personCode,name,address,eMail);
}
s.close();
}
......@@ -48,11 +44,7 @@ public class DataConvereter {
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);*/
new Venues(venueCode,name,address,capacity);
}
s.close();
}
......@@ -74,12 +66,57 @@ public class DataConvereter {
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);*/
new Customer(customerCode,type, primaryContact, name, address);
}
s.close();
}
public void readProduct(){
String fileName = "data/Products.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 productTemp = s.nextLine();
String[] parts = productTemp.split(";");
String code = parts[0];
String type = parts[1];
if(type.equals("SR")){
String name = parts[2];
double cost = Double.parseDouble(parts[3]);
new Refreshments(code,type, name, cost);
}
else if(type.equals("SP")){
String venueCode = parts[2];
double hourlyFee = Double.parseDouble(parts[3]);
new ParkingPass(code,type,venueCode,hourlyFee);
}
else if(type.equals("TG")){
String venueCode = parts[2];
String dateTime = parts[3];
String team1 = parts[4];
String team2 = parts[5];
double pricePerUnit = Double.parseDouble(parts[6]);
new GameTicket(code,type,venueCode, dateTime, team1, team2, pricePerUnit);
}
else if(type.equals("TS")){
String team = parts[2];
String startDate = parts[3];
String endDate = parts[4];
double cost = Double.parseDouble(parts[5]);
new SeasonPass(code, type, team, startDate,endDate,cost);
}
else if(type.equals("SL")){
String ticketCode = parts[2];
double licenseFee = Double.parseDouble(parts[3]);
new PSL(code, type, ticketCode, licenseFee);
}
}
s.close();
}
......
......@@ -3,16 +3,16 @@ package assignment2;
public class GameTicket {
private String code;
private String TG;
private String type;
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){
GameTicket(String code, String type, String venueCode, String dateTime, String team1, String team2, double pricePerUnit){
this.code = code;
this.TG = TG;
this.type = type;
this.venueCode = venueCode;
this.dateTime = dateTime;
this.team1 = team1;
......@@ -28,12 +28,12 @@ public class GameTicket {
this.code = code;
}
public String getTG() {
return TG;
public String getType() {
return type;
}
public void setTG(String TG) {
this.TG = TG;
public void setType(String type) {
this.type = type;
}
public String getVenueCode() {
......
......@@ -5,15 +5,15 @@ package assignment2;
public class PSL {
private String code;
private String SL;
private String type;
private String ticketCode;
private double licenseFee;
PSL(String code, String SL, String ticketCode, double licenseFee){
PSL(String code, String type, String ticketCode, double licenseFee){
this.setCode(code);
this.setSL(SL);
this.setType(type);
this.setTicketCode(ticketCode);
this.setLicenseFee(licenseFee);
}
......@@ -44,14 +44,14 @@ public class PSL {
public void setSL(String sL) {
SL = sL;
public void setType(String type) {
this.type = type;
}
public String getSL() {
return SL;
public String getType() {
return type;
}
......
......@@ -3,13 +3,13 @@ package assignment2;
public class ParkingPass {
private String code;
private String SP;
private String type;
private String venueCode;
private double hourlyFee;
ParkingPass(String code, String SP, String venueCode, double hourlyFee){
ParkingPass(String code, String type, String venueCode, double hourlyFee){
this.setCode(code);
this.setSP(SP);
this.setType(type);
this.setVenueCode(venueCode);
this.setHourlyFee(hourlyFee);
......@@ -31,12 +31,12 @@ public class ParkingPass {
return venueCode;
}
public void setSP(String sP) {
SP = sP;
public void setType(String type) {
this.type = type;
}
public String getSP() {
return SP;
public String getType() {
return type;
}
public void setCode(String code) {
......
......@@ -3,14 +3,14 @@ package assignment2;
public class Refreshments {
private String code;
private String SR;
private String type;
private String name;
private double cost;
Refreshments( String code, String SR, String name, double cost){
Refreshments( String code, String type, String name, double cost){
this.code = code;
this.SR = SR;
this.type = type;
this.name = name;
this.cost = cost;
}
......@@ -26,13 +26,13 @@ public class Refreshments {
}
public String getSR() {
return SR;
public String getType() {
return type;
}
public void setSR(String sR) {
SR = sR;
public void setType(String type) {
this.type = type;
}
......
......@@ -3,16 +3,16 @@ package assignment2;
public class SeasonPass {
private String code;
private String TS;
private String type;
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){
SeasonPass(String code, String type, String team, String startDate, String endDate, double cost){
this.code = code;
this.TS = TS;
this.type = type;
this.team = team;
this.startDate = startDate;
this.endDate = endDate;
......@@ -30,13 +30,13 @@ public class SeasonPass {
}
public String getTS() {
return TS;
public String getType() {
return type;
}
public void setTS(String tS) {
TS = tS;
public void setType(String type) {
this.type = type;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment