I've been pissed with JS lately. Php I can handle.
Does Java return errors?
Have fun, my friend. Have fun. powerofone;
Gibberish.
Quote from: General Socks on May 11, 2008, 08:09:49 PM
Gibberish.
// CodeTester.java
package inventorywarehouse;
import java.util.Scanner;
import javax.swing.JOptionPane;
import javax.swing.*;
public class CodeTester {
String sku;
double price;
int quantity;
String itemdesc;
public CodeTester() {
}
public static void main(String[] args) {
Scanner input = new Scanner( System.in );
final char YES = 'Y';
final char NO = 'N';
final char QUIT = 'Q';
final int INV_NUMBER = 5; // Represents the numbers to be entered for testing purpose
InventoryExtended []invarray = new InventoryExtended [INV_NUMBER]; // create and define the array
System.out.println( "DICKS"); //
System.out.println( "================================================\n");
System.out.println( "The Records are being Generated,Pls Wait ......\n");
System.out.printf("%6s%13s%18s%22s\n", "SKU","Price","Quantity","Description");
// Loop for populating the array
for (int dbase =0; dbase < INV_NUMBER;dbase ++) {
invarray [dbase] = new InventoryExtended ("Number" + dbase,dbase * dbase, dbase * dbase * dbase,"Yoghurt Milk");
}
Warehouse code = new WarehouseExtended (invarray,INV_NUMBER);
System.out.println (code);
while (true){
String ask = JOptionPane.showInputDialog(null,"Do You want To Read A Particular Record");
if (ask == null)
break;
if (ask.toUpperCase().charAt(0) == YES) {
String read = JOptionPane.showInputDialog(null, String.format(" Type The Record Index number" +
" Between 1 And %d.", INV_NUMBER));
int index = Integer.parseInt(read);
if (index == 0) {
JOptionPane.showMessageDialog(null, String.format("Key in The Value You Would Like" +
" To Read Between 1 and %d",INV_NUMBER),
"MAJOR ERROR: Out Of Bounds", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(null, String.format("This is The Record For The Index Value %s:\n %s",
index, code.readRecord(index-1)));
System.out.println(code.readRecord(index-1));
}
} else {
String help = JOptionPane.showInputDialog(null, "Do you want to Delete A Record From The Inventory List?\n");
if (help == null)
break;
if (help.toUpperCase().charAt(0) == YES) {
String delete = JOptionPane.showInputDialog(null, String.format("Type The Product Index Value\n" +
" You Would Like To Delete: Between 1 And %d.", INV_NUMBER), "Warning: Deletion to be done", JOptionPane.WARNING_MESSAGE);
int rec = Integer.parseInt(delete);
if (rec == 0) {
JOptionPane.showMessageDialog(null, String.format("Please Enter A Value Between 1 and %d", INV_NUMBER)
, "MAJOR ERROR: Out Of Bounds", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(null, String.format("Here Is The Record You Have Just Deleted:\n %s", code.readRecord(rec-1)));
System.out.println(code.readRecord(rec-1));
code.removeRecord(rec-1);
System.out.println(code.toString());
}
} else {
String exit = JOptionPane.showInputDialog(null, "Would You Like To Exit From This Program");
if (exit.toUpperCase().charAt(0) == YES){
break;
}
}
}
}
} // End the main method
} // End the class
<Dumb>Fuck this shit, on a shit scale it would be a numerical value of 0, representing penis. </Dumb>