diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.java.tmp deleted file mode 100644 index 562babc..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.java.tmp +++ /dev/null @@ -1,78 +0,0 @@ -package ca.bcit.comp1510.lab11; - -import java.text.DecimalFormat; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - /** name of item. */ - private final String name; - - /** price of item. */ - private final double price; - - /** quanitity of item. */ - private final int quantity; - - /** - * Item constructor. - * @param name of item - * @param price of item - * @param quantity of item - */ - public Item(String name, double price, int quantity) { - this.name = name; - this.quantity = quantity; - DecimalFormat format = new DecimalFormat("#0.00"); - this.price = Double.parseDouble(format.format(price)); - } - - /** - * Item constructor with default quantity. - * @param name of item - * @param price of item - */ - public Item(String name, double price) { - this.name = name; - DecimalFormat format = new DecimalFormat("#0.00"); - this.price = Double.parseDouble(format.format(price)); - this.quantity = 1; - } - - /** - * getName of time. - * @return name of item - */ - public String getName() { - return this.name; - } - - /** - * getPrice of item. - * @return price of item - */ - public double getPrice() { - return this.price; - } - - /** - * getQuantity of item. - * @return quantity of item - */ - public int getQuantity() { - return this.quantity; - } - - /** - * toString gives string representation of item. - * @return string of item. - */ - public String toString() { - return this.name + " $" + this.price - + " x" + this.quantity; - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184119-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184119-KMJBCBL.java.tmp deleted file mode 100644 index 3f6d7f4..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184119-KMJBCBL.java.tmp +++ /dev/null @@ -1,5 +0,0 @@ -package ca.bcit.comp1510.lab11; - -public class Item { - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184149-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184149-KMJBCBL.java.tmp deleted file mode 100644 index eb25a4a..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184149-KMJBCBL.java.tmp +++ /dev/null @@ -1,10 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184219-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184219-KMJBCBL.java.tmp deleted file mode 100644 index b4b90f4..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184219-KMJBCBL.java.tmp +++ /dev/null @@ -1,13 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - private final String name; - - private -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184229-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184229-KMJBCBL.java.tmp deleted file mode 100644 index 86de715..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184229-KMJBCBL.java.tmp +++ /dev/null @@ -1,15 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - private final String name; - - private final double price; - - private final int quantity; -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184249-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184249-KMJBCBL.java.tmp deleted file mode 100644 index 343b305..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184249-KMJBCBL.java.tmp +++ /dev/null @@ -1,16 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - /** name of item. */ - private final String name; - - private final double price; - - private final int quantity; -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184309-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184309-KMJBCBL.java.tmp deleted file mode 100644 index 72e4543..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-184309-KMJBCBL.java.tmp +++ /dev/null @@ -1,18 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - /** name of item. */ - private final String name; - - /** price of item. */ - private final double price; - - /** quanitity of item */ - private final int quantity; -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-185119-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-185119-KMJBCBL.java.tmp deleted file mode 100644 index 99aac4f..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Item.sync-conflict-20250401-185119-KMJBCBL.java.tmp +++ /dev/null @@ -1,83 +0,0 @@ -package ca.bcit.comp1510.lab11; - -import java.text.DecimalFormat; -import java.util.NumberFormat; - -/** - * Item class for POS System. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Item { - - /** name of item. */ - private final String name; - - /** price of item. */ - private final double price; - - /** quanitity of item. */ - private final int quantity; - - /** - * Item constructor. - * @param name of item - * @param price of item - * @param quantity of item - */ - public Item(String name, double price, int quantity) { - this.name = name; - this.price = price; - this.quantity = quantity; - - - DecimalFormat format = new DecimalFormat("#0.00"); - return Double.parseDouble(format.format(a / this.students.size())); - - this.price = - } - - /** - * Item constructor with default quantity. - * @param name of item - * @param price of item - */ - public Item(String name, double price) { - this.name = name; - this.price = price; - this.quantity = 1; - } - - /** - * getName of time. - * @return name of item - */ - public String getName() { - return this.name; - } - - /** - * getPrice of item. - * @return price of item - */ - public double getPrice() { - return this.price; - } - - /** - * getQuantity of item. - * @return quantity of item - */ - public int getQuantity() { - return this.quantity; - } - - /** - * toString gives string representation of item. - * @return string of item. - */ - public String toString() { - return this.name + " $" + this.price - + " x" + this.quantity; - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~LockableDriver.sync-conflict-20250401-181112-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~LockableDriver.sync-conflict-20250401-181112-KMJBCBL.java.tmp deleted file mode 100644 index f841b18..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~LockableDriver.sync-conflict-20250401-181112-KMJBCBL.java.tmp +++ /dev/null @@ -1,19 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * LockableDriver drives Lockable Coin. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class LockableDriver { - - /** - * main program entry. - * @param args unused. - */ - public static void main(String[] args) { - Coin coin = new Coin(); - - - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.java.tmp deleted file mode 100644 index dadb585..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.java.tmp +++ /dev/null @@ -1,85 +0,0 @@ -package ca.bcit.comp1510.lab11; - -import java.util.Scanner; -import java.util.Arrays; - -/** - * ReverseArray is self explanitory. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class ReverseArray { - - /** - * readValidInt reads and validates an integer. - * @param msg to print; - * @param scan to read input - * @return validated int - */ - private static int readValidInt(String msg, Scanner scan) { - int number = 0; - boolean valid = false; - - do { - System.out.print(msg); - - if (!scan.hasNextInt()) { - System.out.println(scan.next() + " is not a valid number.\n"); - continue; - } - - number = scan.nextInt(); - valid = true; - - } while (!valid); - - return number; - } - - /** - * reverseIntArray reverses an array of ints. - * @param arr of ints. - * @return reversed array of ints. - */ - private static int[] reverseIntArray(int[] arr) { - int[] reversed = new int[arr.length]; - - int n; - for (int i = 0; i < arr.length / 2; i++) { - n = arr[arr.length - 1 - i]; - arr[arr.length - 1 - i] = arr[i]; - arr[i] = n; - } - - return reversed; - } - - /** - * main program entry. - * @param args unused - */ - public static void main(String[] args) { - Scanner scan = new Scanner(System.in); - - int length = readValidInt( - "Please enter the length for the array: ", - scan - ); - - int[] arr = new int[length]; - - for (int i = 0; i < length; i++) { - int num = readValidInt( - "Please enter a number: ", - scan - ); - arr[i] = num; - } - - System.out.println(Arrays.toString(arr)); - - arr = reverseIntArray(arr); - - System.out.println(Arrays.toString(arr)); - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181512-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181512-KMJBCBL.java.tmp deleted file mode 100644 index 18e7256..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181512-KMJBCBL.java.tmp +++ /dev/null @@ -1,8 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * ReverseArray is self explanitory. - */ -public class ReverseArray { - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181532-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181532-KMJBCBL.java.tmp deleted file mode 100644 index c970026..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181532-KMJBCBL.java.tmp +++ /dev/null @@ -1,10 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * ReverseArray is self explanitory. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class ReverseArray { - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181552-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181552-KMJBCBL.java.tmp deleted file mode 100644 index f3551a1..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-181552-KMJBCBL.java.tmp +++ /dev/null @@ -1,11 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * ReverseArray is self explanitory. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class ReverseArray { - - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183019-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183019-KMJBCBL.java.tmp deleted file mode 100644 index 521bd84..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183019-KMJBCBL.java.tmp +++ /dev/null @@ -1,58 +0,0 @@ -package ca.bcit.comp1510.lab11; - -import java.util.Scanner; - -/** - * ReverseArray is self explanitory. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class ReverseArray { - - /** - * readValidInt reads and validates an integer. - * @param msg to print; - * @param scan to read input - * @return validated int - */ - private static int readValidInt(String msg, Scanner scan) { - int number = 0; - boolean valid = false; - - do { - System.out.print(msg); - - if (!scan.hasNextInt()) { - System.out.println(scan.next() + " is not a valid number.\n"); - continue; - } - - number = scan.nextInt(); - valid = true; - - } while (!valid); - - return number; - } - - /** - * main program entry. - * @param args unused - */ - public static void main(String[] args) { - Scanner scan = new Scanner(System.in); - - int length = readValidInt( - "Please enter the length for the array: ", - scan - ); - - for (int i = 0; i < length; i++) { - int num = readValidInt( - "Please enter a number: ", - scan - ); - - } - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183909-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183909-KMJBCBL.java.tmp deleted file mode 100644 index 4de444a..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~ReverseArray.sync-conflict-20250401-183909-KMJBCBL.java.tmp +++ /dev/null @@ -1,85 +0,0 @@ -package ca.bcit.comp1510.lab11; - -import java.util.Scanner; -import java.util.Arrays; - -/** - * ReverseArray is self explanitory. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class ReverseArray { - - /** - * readValidInt reads and validates an integer. - * @param msg to print; - * @param scan to read input - * @return validated int - */ - private static int readValidInt(String msg, Scanner scan) { - int number = 0; - boolean valid = false; - - do { - System.out.print(msg); - - if (!scan.hasNextInt()) { - System.out.println(scan.next() + " is not a valid number.\n"); - continue; - } - - number = scan.nextInt(); - valid = true; - - } while (!valid); - - return number; - } - - /** - * reverseIntArray reverses an array of ints. - * @param arr of ints. - * @return reversed array of ints. - */ - private static int[] reverseIntArray(int[] arr) { - int[] reversed = new int[arr.length]; - - int n; - for (int i = 0; i < arr.length / 2; i++) { - n = arr[arr.length - i]; - arr[arr.length - i] = arr[i]; - arr[i] = n; - } - - return reversed; - } - - /** - * main program entry. - * @param args unused - */ - public static void main(String[] args) { - Scanner scan = new Scanner(System.in); - - int length = readValidInt( - "Please enter the length for the array: ", - scan - ); - - int[] arr = new int[length]; - - for (int i = 0; i < length; i++) { - int num = readValidInt( - "Please enter a number: ", - scan - ); - arr[i] = num; - } - - System.out.println(Arrays.toString(arr)); - - arr = reverseIntArray(arr); - - System.out.println(Arrays.toString(arr)); - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Shopping.sync-conflict-20250401-192000-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Shopping.sync-conflict-20250401-192000-KMJBCBL.java.tmp deleted file mode 100644 index ddc9f6a..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Shopping.sync-conflict-20250401-192000-KMJBCBL.java.tmp +++ /dev/null @@ -1,10 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Shopping cart driver. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Shopping { - -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.java.tmp deleted file mode 100644 index c2b18ed..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.java.tmp +++ /dev/null @@ -1,72 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Transaction of items. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Transaction { - - /** items in transaction. */ - private Item[] items; - - /** totalPrice of transaction. */ - private double totalPrice; - - /** itemCount of transaction. */ - private int itemCount; - - /** - * Tramsaction constructor. - * @param size of items; - */ - public Transaction(int size) { - this.items = new Item[size]; - this.totalPrice = 0; - this.itemCount = 0; - } - - /** - * addToCart creates an item to add to cart. - * @param name of item - * @param price of item - * @param quantity of item - */ - public void addToCart(String name, double price, int quantity) { - Item item = new Item(name, price, quantity); - - if (this.itemCount == this.items.length) { - increaseSize(); - } - - this.items[itemCount] = item; - this.itemCount++; - - this.totalPrice += price * quantity; - } - - /** - * addToCart adds existing item to cart. - * @param item to add - */ - public void addToCart(Item item) { - if (this.itemCount == this.items.length) { - increaseSize(); - } - - this.items[itemCount] = item; - this.itemCount++; - - this.totalPrice += item.getPrice() * item.getQuantity(); - } - - /** increaseSize of cart. */ - public void increaseSize() { - final int up = 3; - Item[] updatedItems = new Item[this.items.length + up]; - - for (int i = 0; i < this.itemCount; i++) { - updatedItems[i] = this.items[i]; - } - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190059-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190059-KMJBCBL.java.tmp deleted file mode 100644 index 6145a12..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190059-KMJBCBL.java.tmp +++ /dev/null @@ -1,32 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Transaction of items. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Transaction { - - /** items in transaction. */ - private Item[] items; - - /** totalPrice of transaction. */ - private double totalPrice; - - /** itemCount of transaction. */ - private int itemCount; - - /** - * Tramsaction constructor. - * @param size of items; - */ - public Transaction(int size) { - this.items = new Item[size]; - this.totalPrice = 0; - this.itemCount = 0; - } - - public void addToCart(String name, double price, int quantity) { - Item item = new Item(name, price, quantity); - } -} diff --git a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190827-KMJBCBL.java.tmp b/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190827-KMJBCBL.java.tmp deleted file mode 100644 index c2b18ed..0000000 --- a/src/ca/bcit/comp1510/lab11/~syncthing~Transaction.sync-conflict-20250401-190827-KMJBCBL.java.tmp +++ /dev/null @@ -1,72 +0,0 @@ -package ca.bcit.comp1510.lab11; - -/** - * Transaction of items. - * @author Braeden Sowinski - * @version 1.0.0 - */ -public class Transaction { - - /** items in transaction. */ - private Item[] items; - - /** totalPrice of transaction. */ - private double totalPrice; - - /** itemCount of transaction. */ - private int itemCount; - - /** - * Tramsaction constructor. - * @param size of items; - */ - public Transaction(int size) { - this.items = new Item[size]; - this.totalPrice = 0; - this.itemCount = 0; - } - - /** - * addToCart creates an item to add to cart. - * @param name of item - * @param price of item - * @param quantity of item - */ - public void addToCart(String name, double price, int quantity) { - Item item = new Item(name, price, quantity); - - if (this.itemCount == this.items.length) { - increaseSize(); - } - - this.items[itemCount] = item; - this.itemCount++; - - this.totalPrice += price * quantity; - } - - /** - * addToCart adds existing item to cart. - * @param item to add - */ - public void addToCart(Item item) { - if (this.itemCount == this.items.length) { - increaseSize(); - } - - this.items[itemCount] = item; - this.itemCount++; - - this.totalPrice += item.getPrice() * item.getQuantity(); - } - - /** increaseSize of cart. */ - public void increaseSize() { - final int up = 3; - Item[] updatedItems = new Item[this.items.length + up]; - - for (int i = 0; i < this.itemCount; i++) { - updatedItems[i] = this.items[i]; - } - } -}