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
No related branches found
No related tags found
No related merge requests found
...@@ -23,11 +23,7 @@ public class DataConvereter { ...@@ -23,11 +23,7 @@ public class DataConvereter {
String name = parts[1]; String name = parts[1];
String address = parts[2]; String address = parts[2];
String eMail = parts[3]; String eMail = parts[3];
Person p = new Person(personCode,name,address,eMail); new Person(personCode,name,address,eMail);
/*p.setPersonCode(personCode);
p.setName(name);
p.setAddress(address);
p.seteMail(eMail);*/
} }
s.close(); s.close();
} }
...@@ -48,11 +44,7 @@ public class DataConvereter { ...@@ -48,11 +44,7 @@ public class DataConvereter {
String name = parts[1]; String name = parts[1];
String address = parts[2]; String address = parts[2];
int capacity = Integer.parseInt(parts[3]); int capacity = Integer.parseInt(parts[3]);
Venues v = new Venues(venueCode,name,address,capacity); new Venues(venueCode,name,address,capacity);
/*v.setVenueCode(venueCode);
v.setName(name);
v.setAddress(address);
v.setCapacity(capacity);*/
} }
s.close(); s.close();
} }
...@@ -74,12 +66,57 @@ public class DataConvereter { ...@@ -74,12 +66,57 @@ public class DataConvereter {
String primaryContact = parts[2]; String primaryContact = parts[2];
String name = parts[3]; String name = parts[3];
String address = parts[4]; String address = parts[4];
Customer c = new Customer(customerCode,type, primaryContact, name, address); new Customer(customerCode,type, primaryContact, name, address);
/*c.setCustomerCode(customerCode); }
c.setType(type); s.close();
c.setPrimaryContact(primaryContact); }
c.setName(name); public void readProduct(){
c.setAddress(address);*/ 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(); s.close();
} }
......
...@@ -3,16 +3,16 @@ package assignment2; ...@@ -3,16 +3,16 @@ package assignment2;
public class GameTicket { public class GameTicket {
private String code; private String code;
private String TG; private String type;
private String venueCode; private String venueCode;
private String dateTime; private String dateTime;
private String team1; private String team1;
private String team2; private String team2;
private double pricePerUnit; 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.code = code;
this.TG = TG; this.type = type;
this.venueCode = venueCode; this.venueCode = venueCode;
this.dateTime = dateTime; this.dateTime = dateTime;
this.team1 = team1; this.team1 = team1;
...@@ -28,12 +28,12 @@ public class GameTicket { ...@@ -28,12 +28,12 @@ public class GameTicket {
this.code = code; this.code = code;
} }
public String getTG() { public String getType() {
return TG; return type;
} }
public void setTG(String TG) { public void setType(String type) {
this.TG = TG; this.type = type;
} }
public String getVenueCode() { public String getVenueCode() {
......
...@@ -5,15 +5,15 @@ package assignment2; ...@@ -5,15 +5,15 @@ package assignment2;
public class PSL { public class PSL {
private String code; private String code;
private String SL; private String type;
private String ticketCode; private String ticketCode;
private double licenseFee; 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.setCode(code);
this.setSL(SL); this.setType(type);
this.setTicketCode(ticketCode); this.setTicketCode(ticketCode);
this.setLicenseFee(licenseFee); this.setLicenseFee(licenseFee);
} }
...@@ -44,14 +44,14 @@ public class PSL { ...@@ -44,14 +44,14 @@ public class PSL {
public void setSL(String sL) { public void setType(String type) {
SL = sL; this.type = type;
} }
public String getSL() { public String getType() {
return SL; return type;
} }
......
...@@ -3,13 +3,13 @@ package assignment2; ...@@ -3,13 +3,13 @@ package assignment2;
public class ParkingPass { public class ParkingPass {
private String code; private String code;
private String SP; private String type;
private String venueCode; private String venueCode;
private double hourlyFee; 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.setCode(code);
this.setSP(SP); this.setType(type);
this.setVenueCode(venueCode); this.setVenueCode(venueCode);
this.setHourlyFee(hourlyFee); this.setHourlyFee(hourlyFee);
...@@ -31,12 +31,12 @@ public class ParkingPass { ...@@ -31,12 +31,12 @@ public class ParkingPass {
return venueCode; return venueCode;
} }
public void setSP(String sP) { public void setType(String type) {
SP = sP; this.type = type;
} }
public String getSP() { public String getType() {
return SP; return type;
} }
public void setCode(String code) { public void setCode(String code) {
......
...@@ -3,14 +3,14 @@ package assignment2; ...@@ -3,14 +3,14 @@ package assignment2;
public class Refreshments { public class Refreshments {
private String code; private String code;
private String SR; private String type;
private String name; private String name;
private double cost; 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.code = code;
this.SR = SR; this.type = type;
this.name = name; this.name = name;
this.cost = cost; this.cost = cost;
} }
...@@ -26,13 +26,13 @@ public class Refreshments { ...@@ -26,13 +26,13 @@ public class Refreshments {
} }
public String getSR() { public String getType() {
return SR; return type;
} }
public void setSR(String sR) { public void setType(String type) {
SR = sR; this.type = type;
} }
......
...@@ -3,16 +3,16 @@ package assignment2; ...@@ -3,16 +3,16 @@ package assignment2;
public class SeasonPass { public class SeasonPass {
private String code; private String code;
private String TS; private String type;
private String team; private String team;
private String startDate; private String startDate;
private String endDate; private String endDate;
private double cost; 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.code = code;
this.TS = TS; this.type = type;
this.team = team; this.team = team;
this.startDate = startDate; this.startDate = startDate;
this.endDate = endDate; this.endDate = endDate;
...@@ -30,13 +30,13 @@ public class SeasonPass { ...@@ -30,13 +30,13 @@ public class SeasonPass {
} }
public String getTS() { public String getType() {
return TS; return type;
} }
public void setTS(String tS) { public void setType(String type) {
TS = tS; this.type = type;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment