Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fixed an issue where lowercase car registration inputs resulted in bl…
Browse files Browse the repository at this point in the history
…ank receipts
  • Loading branch information
yewhan committed Aug 12, 2021
1 parent 7a2cb0f commit 91e6bf9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions out/production/COMP2000_Referral/cars.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TRUE:CORSA:KFS5265:15.0:0
TRUE:VECTRA:EBZ5155:18.0:0
FALSE:TESLA X:1234:25.0:2021-09-10
TRUE:TESLA X:1234:25.0:0
TRUE:SUPRA:123456:14.0:0
TRUE:ASTON MARTIN DB5:MI6:50.95:0
2 changes: 1 addition & 1 deletion out/production/COMP2000_Referral/customer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ EUAN:HUGHES:TEST ROAD:123ABC:0
BOB:DYLAN:124 DYLAN DRIVE, PLYMOUTH, PL2 6JK:AB123CD:0
ROBERT:PLANT:123 LED LANE, PLYMOUTH, PL1 2LB:CD1234BA:0
FIRST:LAST:TEST LANE:TEST12:0
JAMES:BOND:NEWTON ABBOT ROAD:007:1234
JAMES:BOND:NEWTON ABBOT:007:0
4 changes: 2 additions & 2 deletions resources/cars.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TRUE:CORSA:KFS5265:15.0:0
TRUE:VECTRA:EBZ5155:18.0:0
FALSE:TESLA X:1234:25.0:2021-09-10
TRUE:TESLA X:1234:25.0:0
TRUE:SUPRA:123456:14.0:0
TRUE:ASTON MARTIN DB5:MI6:50.95:0
2 changes: 1 addition & 1 deletion resources/customer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ EUAN:HUGHES:TEST ROAD:123ABC:0
BOB:DYLAN:124 DYLAN DRIVE, PLYMOUTH, PL2 6JK:AB123CD:0
ROBERT:PLANT:123 LED LANE, PLYMOUTH, PL1 2LB:CD1234BA:0
FIRST:LAST:TEST LANE:TEST12:0
JAMES:BOND:NEWTON ABBOT ROAD:007:1234
JAMES:BOND:NEWTON ABBOT:007:0
4 changes: 3 additions & 1 deletion src/Receipt.form
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
<children>
<component id="d146f" class="javax.swing.JTextPane" binding="txtReceipt">
<constraints/>
<properties/>
<properties>
<editable value="false"/>
</properties>
</component>
</children>
</scrollpane>
Expand Down
2 changes: 1 addition & 1 deletion src/StockController.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void populateStockGUI(JList<String> lstStock, boolean accountType) {
public String[] getCarDetails(String carReg) {
String[] $arr = new String[5];
for (Stock c : carList) {
if (c.getRegistration().equals(carReg)) { //if registration matches one in car database, populate string array with car details
if (c.getRegistration().equalsIgnoreCase(carReg)) { //if registration matches one in car database, populate string array with car details
$arr[0] = c.getAvailable().toString();
$arr[1] = c.getModel();
$arr[2] = c.getRegistration();
Expand Down

0 comments on commit 91e6bf9

Please sign in to comment.