Checking Account and help with code ?

Hi all..my computer hung up on me, so I'm not sure if my last post went through. First of all thank you all for helping me out the other day with my question on the Bank Account. It continues :)
I'm trying to work on each class one by one..when I test my Checking Account, it isn't printing out the correct balance. The string method to print this is coming from the Withdrawal class...so I know it has to be somewhere in there but I can't seem to figure out why it isn't totalling the balance...or how to get it too.
Then when I test my MyBank class, it hangs up on line 63..which I could swear I have written correctly. Again I am getting a NullPointerException and I honestly think I have the line of code written right, but I'm guessing I dont.
Any help would be appreciated.
public abstract class BankAccount {
    public static final String bankName = "BrianBank";
    protected String custName;
    protected String pin;
    protected Transaction[] history;
    private double balance;
    private double amt, amount;
    private double bal, initBal;
    private int transactions;
    private final int MAX_HISTORY = 100;
    private int acct;
    protected BankAccount(String cname, String cpin, double initBal) {
     custName = cname;
     pin = cpin;
     balance = initBal;
     history = new Transaction[MAX_HISTORY];
     transactions =0;
    public double getBalance() {
     return balance;
    public void withdraw(double amt) {
     history [transactions] = new Withdrawal (bal, amt);
   balance = bal;
     amount = amt;
     balance -= amt;
   transactions = transactions + 1;     
    public void deposit(double amt) {     
     history [transactions] = new Deposit (bal, amt);
     balance = bal;
     amount = amt;
     balance += amt;
     transactions = transactions +1;
    // abstract method to return account number
    public abstract int getAcctNum();
    // abstract method to return a summary of transactions as a string
    public abstract String getStatement();
public class CheckingAccount extends BankAccount implements IncursFee
      private int transactions;
      private double balance, initBal, amt;
      private static final int NOFEE_WITHDRAWALS = 10;
      private static final double TRANSACTION_FEE = 5.00;
      public static final String bankName = "iBank";
      public static final int STARTING_ACCOUNT_NUMBER = 10000;
      private int checkingAccountNumber = STARTING_ACCOUNT_NUMBER;
      private static int accountNumberCounter = STARTING_ACCOUNT_NUMBER;
      private String custName;
      private String pin;
      public CheckingAccount (String cname, String cpin, double initBal)
         super (cname, cpin, initBal);
          custName = cname;
          pin = cpin;
         balance = initBal;
         accountNumberCounter++; 
         checkingAccountNumber = accountNumberCounter;
      //initialize a count of transactions
         transactions = 0;          
       public double getBalance()
         return balance;
       public void withdraw(double amt)
        super.withdraw (amt);
         transactions ++;
       public void deposit(double amt)
       super.deposit (amt);
         transactions ++;
       public int getAcctNum ()
         return checkingAccountNumber;     
       public String getStatement ()
         int i = 0;
         String output = "";
         while ( i < history.length && history[i] != null )
            output += history.toString () + "\n";
i++;
return output;     
public void deductFee(double fee)
if (transactions > NOFEE_WITHDRAWALS)
{  fee = TRANSACTION_FEE *(transactions - NOFEE_WITHDRAWALS);
super.withdraw(fee);
balance -=fee;
transactions = 0;
public interface IncursFee {
public abstract void deductFee(double fee);
public abstract class Transaction {
protected double initBal;
protected double tranAmt;
// constructor
protected Transaction(double bal, double amt) {
     initBal = bal;
     tranAmt = amt;
abstract public String toString();
public class Withdrawal extends Transaction
     private double initBal;
     private double amount;
     private static NumberFormat fmt = NumberFormat.getCurrencyInstance();
     public Withdrawal (double bal, double amt)
          super (bal, amt);
          initBal = bal;
          amount = amt;
     public String toString ()
     return "Balance : " + fmt.format(initBal) + "\n" + "Withdrawal : " + fmt.format(amount);
import java.text.NumberFormat;
public class Deposit extends Transaction
     private double initbal, balance;
     private double amount;
     private static NumberFormat fmt = NumberFormat.getCurrencyInstance();
     public Deposit (double bal, double amt)
     super (bal, amt);
     initbal = bal;
     amount = amt;
     public String toString ()
     return "Balance : " + fmt.format(initbal) + "\n" + "Deposit : " + fmt.format(amount);
public class TestCheckingAcct {
public static void main(String[] args) {
     BankAccount b1 = new CheckingAccount("Harry", "1234", 500.0);
     System.out.println (b1.getBalance ());
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.deposit(50);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.deposit(10);
     b1.withdraw(1);
     System.out.println(b1.getStatement());
// This interface specifies the functionality requirements of a bank
public interface Bank {
public abstract int openNewAccount(String customerName, String customerPIN, String accType, double initDepAmount);
public abstract void processWithdrawal(int accNum, String pin, double amount);
// executes a deposit on the specified acct by the amount
public abstract void processDeposit(int accNum, String pin, double amount);
// returns the balance of acct
public abstract double processBalanceInquiry(int accNum, String pin);
// returns summary of transactions
public abstract String processStatementInquiry(int accNum, String pin);
import java.util.ArrayList;
public class MyBank implements Bank
private ArrayList<BankAccount> savAccounts = new ArrayList<BankAccount>(); //dynamically grows
private ArrayList<BankAccount> chkAccounts = new ArrayList<BankAccount>(); //dynamically grows
private SavingsAccount sav;
private CheckingAccount chk;
private int accNum;
private String customerName, customerPIN, accType, pin;
private double initDepAmount, amount, balance;
public int openNewAccount(String customerName, String customerPIN, String accType, double initDepAmount)
this.customerName = customerName;
this.customerPIN = customerPIN;
this.accType = accType;
this.initDepAmount = initDepAmount;
if ( accType.equals("Savings"))
BankAccount savAcct = new SavingsAccount(customerName, customerPIN, initDepAmount);
try
savAccounts.add(savAcct);
catch (ArrayIndexOutOfBoundsException savAccounts)
return savAcct.getAcctNum();
else
CheckingAccount chkAcct = new CheckingAccount(customerName, customerPIN, initDepAmount);
     try
chkAccounts.add(chkAcct);
catch (ArrayIndexOutOfBoundsException chkAccounts)
return chkAcct.getAcctNum();
public void processWithdrawal (int accNum, String pin, double amount)
     this.accNum = accNum;
     this.pin = pin;
     this.amount = amount;
if (accNum >10000 && accNum < 20000)
     chk.withdraw (amount);
if (accNum >50000 && accNum <60000)
     sav.withdraw (amount);
public void processDeposit (int accNum, String pin, double amount)
     this.accNum = accNum;
     this.pin = pin;
     this.amount = amount;
if (accNum >10000 && accNum < 20000)
     chk.deposit (amount);
if (accNum >50000 && accNum <60000)
     sav.deposit (amount);
public double processBalanceInquiry (int accNum, String pin)
     this.accNum = accNum;
     this.pin = pin;
     this.balance = 0;
if (accNum >10000 && accNum <20000)
     balance = chk.getBalance ();
if (accNum >50000 && accNum <60000)
     balance = sav.getBalance ();
return balance;
public String processStatementInquiry(int accNum, String pin)
     this.accNum = accNum;
     this.pin = pin;
     this.statement = "";
if (accNum >10000 && accNum <20000)
statement = chk.getStatement ();
if (accNum >50000 && accNum <60000)
statement= sav.getStatement ();
     return statement;

Here's some quick code review:
public abstract class BankAccount {
public static final String bankName =
me = "BrianBank";
protected String custName;
protected String pin;
protected Transaction[] history;
private double balance;
private double amt, amount;
private double bal, initBal;
private int transactions;// make MAX_HISTORY private static final, too.
private final int MAX_HISTORY = 100;
private int acct;
protected BankAccount(String cname, String cpin,
pin, double initBal) {
     custName = cname;
     pin = cpin;
     balance = initBal;
     history = new Transaction[MAX_HISTORY];
     transactions =0;
public double getBalance() {
     return balance;
public void withdraw(double amt) {
     history [transactions] = new Withdrawal (bal, amt);
balance = bal;
     amount = amt;
     balance -= amt;// ++transactions above would be elegant.
transactions = transactions + 1;     
public void deposit(double amt) {     
     history [transactions] = new Deposit (bal, amt);
     balance = bal;
     amount = amt;
     balance += amt;
     transactions = transactions +1;
// abstract method to return account number// why abstract?
public abstract int getAcctNum();
// abstract method to return a summary of
y of transactions as a string// why abstract?
public abstract String getStatement();
public class CheckingAccount extends BankAccount
implements IncursFee
private int transactions;
private double balance, initBal, amt;
private static final int NOFEE_WITHDRAWALS =
WALS = 10;
private static final double TRANSACTION_FEE =
_FEE = 5.00;
public static final String bankName = "iBank";
public static final int STARTING_ACCOUNT_NUMBER
NUMBER = 10000;
private int checkingAccountNumber =
mber = STARTING_ACCOUNT_NUMBER;
private static int accountNumberCounter =
nter = STARTING_ACCOUNT_NUMBER;// BankAccount has a custName attribute; why does CheckingAccount need
// one if it extends BankAccount?
private String custName;
private String pin;
public CheckingAccount (String cname, String
String cpin, double initBal)
super (cname, cpin, initBal);
custName = cname;
pin = cpin;
balance = initBal;
accountNumberCounter++;
checkingAccountNumber =
tNumber = accountNumberCounter;
//initialize a count of transactions
transactions = 0;          
// same as BankAccount - why rewrite it?
public double getBalance()
return balance;
// same as BankAccount - why rewrite it?
public void withdraw(double amt)
super.withdraw (amt);
transactions ++;
// same as BankAccount - why rewrite it?
public void deposit(double amt)
super.deposit (amt);
transactions ++;
          // same as BankAccount - why rewrite it?
public int getAcctNum ()
return checkingAccountNumber;     
public String getStatement ()
int i = 0;
String output = "";
while ( i < history.length && history[i] !=
ory[i] != null )
output += history.toString () + "\n";
i++;
return output;     
public void deductFee(double fee)
if (transactions > NOFEE_WITHDRAWALS)
{  fee = TRANSACTION_FEE *(transactions -
ansactions - NOFEE_WITHDRAWALS);
super.withdraw(fee);
balance -=fee;
transactions = 0;
public interface IncursFee {
public abstract void deductFee(double fee);
public abstract class Transaction {
protected double initBal;
protected double tranAmt;
// constructor
// why protected? make it public.
protected Transaction(double bal, double amt) {
     initBal = bal;
     tranAmt = amt;
abstract public String toString();
public class Withdrawal extends Transaction
     private double initBal;
     private double amount;
private static NumberFormat fmt =
= NumberFormat.getCurrencyInstance();
     public Withdrawal (double bal, double amt)
          super (bal, amt);
          initBal = bal;
          amount = amt;
     public String toString ()
return "Balance : " + fmt.format(initBal) + "\n" +
+ "Withdrawal : " + fmt.format(amount);
import java.text.NumberFormat;
public class Deposit extends Transaction
     private double initbal, balance;
     private double amount;
private static NumberFormat fmt =
= NumberFormat.getCurrencyInstance();
     public Deposit (double bal, double amt)
     super (bal, amt);
     initbal = bal;
     amount = amt;
     public String toString ()
return "Balance : " + fmt.format(initbal) + "\n" +
+ "Deposit : " + fmt.format(amount);
public class TestCheckingAcct {
public static void main(String[] args) {
BankAccount b1 = new CheckingAccount("Harry",
, "1234", 500.0);
     System.out.println (b1.getBalance ());
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.deposit(50);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.withdraw(1);
     b1.deposit(10);
     b1.withdraw(1);
     System.out.println(b1.getStatement());
// This interface specifies the functionality
requirements of a bank
public interface Bank {
public abstract int openNewAccount(String
String customerName, String customerPIN, String
accType, double initDepAmount);
public abstract void processWithdrawal(int
(int accNum, String pin, double amount);
// executes a deposit on the specified acct by
t by the amount
public abstract void processDeposit(int accNum,
Num, String pin, double amount);
// returns the balance of acct
public abstract double processBalanceInquiry(int
(int accNum, String pin);
// returns summary of transactions
public abstract String
ring processStatementInquiry(int accNum, String
pin);
import java.util.ArrayList;
public class MyBank implements Bank
private ArrayList<BankAccount> savAccounts =
unts = new ArrayList<BankAccount>(); //dynamically
grows
private ArrayList<BankAccount> chkAccounts =
unts = new ArrayList<BankAccount>(); //dynamically
grows
private SavingsAccount sav;
private CheckingAccount chk;
private int accNum;
private String customerName, customerPIN,
erPIN, accType, pin;
private double initDepAmount, amount, balance;
public int openNewAccount(String customerName,
erName, String customerPIN, String accType, double
initDepAmount)
this.customerName = customerName;
this.customerPIN = customerPIN;
this.accType = accType;
this.initDepAmount = initDepAmount;
if ( accType.equals("Savings"))
BankAccount savAcct = new
vAcct = new SavingsAccount(customerName, customerPIN,
initDepAmount);
try
savAccounts.add(savAcct);
catch (ArrayIndexOutOfBoundsException
Exception savAccounts)
return savAcct.getAcctNum();
else
CheckingAccount chkAcct = new
hkAcct = new CheckingAccount(customerName,
customerPIN, initDepAmount);
     try
chkAccounts.add(chkAcct);
catch (ArrayIndexOutOfBoundsException
Exception chkAccounts)
return chkAcct.getAcctNum();
public void processWithdrawal (int accNum,
accNum, String pin, double amount)
     this.accNum = accNum;
     this.pin = pin;
     this.amount = amount;
if (accNum >10000 && accNum < 20000)
     chk.withdraw (amount);
if (accNum >50000 && accNum <60000)
     sav.withdraw (amount);
public void processDeposit (int accNum, String
String pin, double amount)
     this.accNum = accNum;
     this.pin = pin;
     this.amount = amount;
if (accNum >10000 && accNum < 20000)
     chk.deposit (amount);
if (accNum >50000 && accNum <60000)
     sav.deposit (amount);
public double processBalanceInquiry (int accNum,
String pin)
     this.accNum = accNum;
     this.pin = pin;
     this.balance = 0;
if (accNum >10000 && accNum <20000)
     balance = chk.getBalance ();
if (accNum >50000 && accNum <60000)
     balance = sav.getBalance ();
return balance;
public String processStatementInquiry(int accNum,
m, String pin)
     this.accNum = accNum;
     this.pin = pin;
     this.statement = "";
if (accNum >10000 && accNum <20000)
statement = chk.getStatement ();
if (accNum >50000 && accNum <60000)
statement= sav.getStatement ();
     return statement;
Very bad style with those brace placements. Pick a style and stick with it. Consistency is the key.
Your code isn't very readable.
You don't have a SavingsAccount here anywhere, even though your MyBank uses one.
You use JDK 1.5 generics yet you've got ArrayList as the static type on those declarations. Better to use the interface type List as the compile time type on the LHS.
You have a lot of compile time problems, and some incomprehensible stuff, but I was able to change it enough to my TestCheckingAcct run to completion. No NPE exceptions.
I'm not sure I agree with your design.
No SavingsAccount. The accounts I have ALL incur fees - no need for a special interface there. Savings accounts are usually interest bearing. That's the way they behave differently from checking accounts. Where do you have that?
You rewrite too much code. If you put behavior in the abstract BankingAccount class (a good idea), the whole idea is that concrete classes that extend BankingAccount don't need to overload any methods whose default behavior is correct for them.
I don't know that I'd have separate Deposit and Withdrawal to implement Transaction. I'd make Transaction concrete and have starting balance, ending balance, and a transaction type String (e.g., "DEPOSIT", "WITHDRAWAL")
It'd be good to see some thought put into exception handling. I don't see an OverdrawnException anywhere. Seems appropriate.
No transfer methods from one account to another. I often do that with my bank.
That's enough to get started.

Similar Messages

  • Combo box and Check box..help with code please?

    Here is my problem...i have a list of check boxes and according to which one is checked, i need combo boxes to populate different choices.
    as an easy example im only using 2 check boxes and two combo boxes.
    the check boxes are named Choice 1or2 with export values of 1 and 2
    the Combo Boxes are named List A and List B..
    both containing options that say you checked box 1 and you checked box 2
    any help would be greatly appreciated

    Implode wrote:
    "Help with code please."
    In the future, please use a meaningful subject. Given that you're posting here, it's kind of a given that you're looking for help with the code. The whole point of the subject is to give people a high level idea of what KIND of help with what KIND of code you need, so they can decide if they're interested and qualified to help.
    Exception in thread "main" java.lang.NumberFormatException: For input string: "fgg"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at assignment1.Game.Start(Game.java:120)
         at assignment1.RunGame.main(RunGame.java:18)This error message is telling you exactly what's wrong. At line 120 of Game.java, in the Start method (which should start with lowercase "s" to follow conventions, by the way), you're calling Integer.parseInt, but "fgg" is not a valid int.

  • I need advise and help with this problem . First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product . At the present time I'm having lots of problems with the router so I was looking in to

    I need advise and help with this problem .
    First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
    At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
    In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
    Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
    trace in Spotlight , Library . Nothing could be find .
    Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
    ''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
    With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
    I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
    Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respond

    Genieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
    To remove it, see:
    http://www.thesafemac.com/arg-genieo/
    Do not use the Genieo uninstaller!

  • My wife and I had one iCloud account and now with our multiple devices, we want to separate our clouds, how do I do that?

    My wife and I had one iCloud account and now with our multiple devices, we want to separate our clouds, how do I do that?

    As quicksilver8 says, that's difficult.
    See Transferring files from one User Account to another for some suggestions.

  • Newbie needing help with code numbers and if-else

    I'm 100% new to any kind of programming and in my 4th week of an Intro to Java class. It's also an on-line class so my helpful resources are quite limited. I have spent close to 10 hours on my class project working out P-code and the java code itself, but I'm having some difficulty because the project seems to be much more advanced that the examples in the book that appear to only be partly directly related to this assignment. I have finally come to a point where I am unable to fix the mistakes that still show up. I'm not trying to get anyone to do my assignment for me, I'm only trying to get some help on what I'm missing. I want to learn, not cheat.
    Okay, I have an assignment that, in a nutshell, is a cash register. JOptionPane prompts the user to enter a product code that represents a product with a specific price. Another box asks for the quanity then displays the cost, tax and then the total amount plus tax, formatted in dollars and cents. It then repeats until a sentinel of "999" is entered, and then another box displays the total items sold for the day, amount of merchandise sold, tax charged, and the total amount acquired for the day. If a non-valid code is entered, I should prompt the user to try again.
    I have this down to 6 errors, with one of the errors being the same error 5 times. Here are the errors:
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:50: 'else' without 'if'
    else //if invalid code entered, output message
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:39: unexpected type
    required: variable
    found : value
    100 = 2.98;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:41: unexpected type
    required: variable
    found : value
    200 = 4.50;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:43: unexpected type
    required: variable
    found : value
    300 = 6.79;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:45: unexpected type
    required: variable
    found : value
    400 = 5.29;
    ^
    C:\PROGRA~1\XINOXS~1\JCREAT~1\MyProjects\Sales.java:47: unexpected type
    required: variable
    found : value
    500 = 7.20;
    ^
    And finally, here is my code. Please be gentle with the criticism. I've really put a lot into it and would appreciate any help. Thanks in advance.
    import java.text.NumberFormat; // class for numeric formating from page 178
    import javax.swing.JOptionPane; // class for JOptionOPane
    public class Sales {
    //main method begins execution ofJava Application
    public static void main( String args[] )
    double quantity; // total of items purchased
    double tax; // total of tax
    double value; // total cost of all items before tax
    double total; // total of items including tax
    double totValue; // daily value counter
    double totTax; // daily tax counter
    double totTotal; // daily total amount collected (+tax) counter
    double item; //
    String input; // user-entered value
    String output; // output string
    String itemString; // item code entered by user
    String quantityString; // quantity entered by user
    // initialization phase
    quantity = 0; // initialize counter for items purchased
    // get first code from user
    itemString = JOptionPane.showInputDialog(
    "Enter item code:" );
    // convert itemString to double
    item = Double.parseDouble ( itemString );
    // loop until sentinel value read from user
    while ( item != 999 ) {
    // converting code to amount using if statements
    if ( item == 100 )
    100 = 2.98;
    if ( item == 200 )
    200 = 4.50;
    if ( item == 300 )
    300 = 6.79;
    if ( item == 400 )
    400 = 5.29;
    if ( item == 500 )
    500 = 7.20;
    else //if invalid code entered, output message
    JOptionPane.showMessageDialog( null, "Invalid code entered, please try again!",
    "Item Code", JOptionPane.INFORMATION_MESSAGE );
    } // end if
    } // end while
    // get quantity of item user
    itemString = JOptionPane.showInputDialog(
    "Enter quantity:" );
    // convert quantityString to int
    quantity = Double.parseDouble ( quantityString );
    // add quantity to quantity
    quantity = quantity + quantity;
    // calculation time! value
    value = quantity * item;
    // calc tax
    tax = value * .07;
    // calc total
    total = tax + value;
    //add totals to counter
    totValue = totValue + value;
    totTax = totTax + tax;
    totTotal = totTotal + total;
    // display the results of purchase
    JOptionPane.showMessageDialog( null, "Amount: " + value +
    "\nTax: " + tax + "\nTotal: " + total, "Sale", JOptionPane.INFORMATION_MESSAGE );
    // get next code from user
    itemString = JOptionPane.showInputDialog(
    "Enter item code:" );
    // If sentinel value reached
    if ( item == 999 ) {
    // display the daily totals
    JOptionPane.showMessageDialog( null, "Total amount of items sold today: " + quantity +
    "\nValue of ites sold today: " + totValue + "\nTotal tax collected today: " + totTax +
    "\nTotal Amount collected today: " + totTotal, "Totals", JOptionPane.INFORMATION_MESSAGE );
    System.exit( 0 ); // terminate application
    } // end sentinel
    } // end message
    } // end class Sales

    Here you go. I haven't tested this but it does compile. I've put in a 'few helpful hints'.
    import java.text.NumberFormat; // class for numeric formating from page 178
    import javax.swing.JOptionPane; // class for JOptionOPane
    public class TestTextFind {
    //main method begins execution ofJava Application
    public static void main( String args[] )
         double quantity; // total of items purchased
         double tax; // total of tax
         double value; // total cost of all items before tax
         double total; // total of items including tax
    //     double totValue; // daily value counter
    //     double totTax; // daily tax counter
    //     double totTotal; // daily total amount collected (+tax) counter
    // Always initialise your numbers unless you have a good reason not too
         double totValue = 0; // daily value counter
         double totTax = 0; // daily tax counter
         double totTotal = 0; // daily total amount collected (+tax) counter
         double itemCode;
         double item = 0;
         String itemCodeString; // item code entered by user
         String quantityString; // quantity entered by user
         // initialization phase
         quantity = 0; // initialize counter for items purchased
         // get first code from user
         itemCodeString = JOptionPane.showInputDialog("Enter item code:" );
         // convert itemString to double
         itemCode = Double.parseDouble ( itemCodeString );
         // loop until sentinel value read from user
         while ( itemCode != 999 ) {
    * 1. variable item mightnot have been initialised
    * You had item and itemCode the wrong way round.
    * You are supposed to be checking itemCode but setting the value
    * for item
              // converting code to amount using if statements
              if ( item == 100 )
              {itemCode = 2.98;}
              else if ( item == 200 )
              {itemCode = 4.50;}
              else if ( item == 300 )
              {itemCode = 6.79;}
              else if ( item == 400 )
              {itemCode = 5.29;}
              else if ( item == 500 )
              {itemCode = 7.20;}
              else {//if invalid code entered, output message
                   JOptionPane.showMessageDialog( null, "Invalid code entered, please try again!",
                   "Item Code", JOptionPane.INFORMATION_MESSAGE );
              } // end if
         } // end while
         // get quantity of item user
         itemCodeString = JOptionPane.showInputDialog("Enter quantity:" );
    * 2.
    * You have declared quantityString here but you never give it a value.
    * I think this should be itemCodeString shouldnt it???
    * Or should you change itemCodeString above to quantityString?
         // convert quantityString to int
    //     quantity = Double.parseDouble ( quantityString );  // old code
         quantity = Double.parseDouble ( itemCodeString );
         // add quantity to quantity
         quantity = quantity + quantity;
         // calculation time! value
         value = quantity * itemCode;
         // calc tax
         tax = value * .07;
         // calc total
         total = tax + value;
         //add totals to counter
    * 3. 4. and 5.
    * With the following you have not assigned the 'total' variables a value
    * so in effect you are saying eg. "total = null + 10". Thats why an error is
    * raised.  If you look at your declaration i have assigned them an initial
    * value of 0.
         totValue = totValue + value;
         totTax = totTax + tax;
         totTotal = totTotal + total;
         // display the results of purchase
         JOptionPane.showMessageDialog( null, "Amount: " + value +
         "\nTax: " + tax + "\nTotal: " + total, "Sale", JOptionPane.INFORMATION_MESSAGE );
         // get next code from user
         itemCodeString = JOptionPane.showInputDialog("Enter item code:" );
         // If sentinel value reached
         if ( itemCode == 999 ) {
              // display the daily totals
              JOptionPane.showMessageDialog( null, "Total amount of items sold today: " + quantity +
              "\nValue of ites sold today: " + totValue + "\nTotal tax collected today: " + totTax +
              "\nTotal Amount collected today: " + totTotal, "Totals",           JOptionPane.INFORMATION_MESSAGE );
              System.exit( 0 ); // terminate application
         } // end sentinel
    } // end message
    } // end class SalesRob.

  • HT3702 Is there a way to pay with a checking account and not a debit card?

    My debit card was deactivated but my checking account is still valid.  Is there anyway around this?  I have 16 updates waiting to download but I cant download them because of the invalid card.

    Yes.  Write a check to yourself and take it to the bank to get cash.  Take the cash to a store and buy some iTunes gift cards.  Then you can redeem those cards and use the credits in your account to buy stuff.

  • Tips and help with re-installing Lion over Snow Leopard

    I had MAJOR issues with my initial Lion install on my Mid-2009 MBP- so much so, that I had to wipe my hard drive and re-install Snow Leopard and all my applications. My major issues were as follows:
    1. All my files were locked out- I could open them in most cases, but I couldn't overwrite them- Lion had aded some funky permissions scheme that I didn't recognize, and my user name wasn't present on any of them. In some cases, I couldn't even open files, even though they were resident on my hard drive (and in my own user folder) before the upgrade to Lion.
    2. Apple's own Universal Binary apps wouldn't work after the upgrade. Final Cut Pro 6, in particular, came up with a message that it was a "PowerPC" app and wouldn't run- yet Shake 4.1 would run just fine!
    3. Adobe Creative Suite 3- after the upgrade, my Abode Ceative Suite 3 apps worked just fine, for about a day- that is, until I tried to correct the file permissions issue by changing permission on a few of my folders in my User folder (and electing to change permissions in the files contained therein)- at which point my Adobe apps told me that they were damaged and needed to be reinstalled. Yet after uninstaling and reinstalling the entire Creative Suite 3 times, I still would get the same message.
    My entire workflow is Adobe CS and FCS2- why chould I have to pay the upgrade costs just to use Lion? FCPX is completely brkoen for my workflow and eqipment, and Adobe can't even guarantee that CS5 works with Lion- so why does Apple insist on Lion when it's hardly even compatible with its own products?
    I really want to use Lion, but I am looking for some tips on instalation to kep these problems from happening again. I didn' have ANY of these problems with upgrading OS 10.2 through 10.6. Any help with prepping my system/files for upgrading would be helpful. Thanks!

    any new Apple kB articles
    http://support.apple.com/kb/index?page=articles
    Me, I think clone backups are more useful, and only use T.M. as secondary.
    Using Cloning as a Backup Strategy
    I'd assume that professional apps may need to be tested still; and of course check to see what you have that depends on PowerPC code and Rosetta first. That has some in a tither.
    A clone lets you still be able to boot Snow Leopard. Check out Carbon Copy, SuperDuper.

  • Need help with code

    Hi,
    I'm new to java, i'm creating java analog clock application. but i'm getting so many errors. i still try to figur out what are those. can someone please help me with this code. Thank you
    here is my code
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.text.*;
    import javax.swing.*;
    //The main class
    public class AnalogClock extends JFrame
    // Initialize all the variables
    SimpleDateFormat f_s = new SimpleDateFormat ("ss", Locale.getDefault());
    SimpleDateFormat f_m = new SimpleDateFormat ("mm", Locale.getDefault());
    SimpleDateFormat f_h = new SimpleDateFormat ("hh", Locale.getDefault());
    SimpleDateFormat standard = new SimpleDateFormat ("HH:mm:ss", Locale.getDefault());
    int xs, ys, xm, ym, xh, yh, s, xcenter, ycenter, m, h, x, y, mouse_x, mouse_y;
    String temp;
    Dimension d;
    Date now;
    Thread thr = null;
    Image im;
    Boolean M = false;
    Graphics gIm;
    Dimension dIm;
    int sx, sy, sx2, sy2;
    Color digital = Color.blue, hour = Color.blue, minute = Color.yellow,
    second = Color.green, circle = Color.red, hours = Color.blue, mute_logo = Color.green;
    // paint(): the main part of the program
    public void paint(Graphics g)
    d = getSize();
    xcenter = d.width/2;
    ycenter = d.height/2;
    x = d.width;
    y = d.height;
    if(im == null)
    im = createImage(x, y);
    gIm = im.getGraphics();
    dIm = new Dimension(x, y);
    // Get the current timestamp
    now = new Date();
    // Get the seconds
    temp = f_s.format(now);
    s = Integer.parseInt(temp);
    temp = f_m.format(now);
    m = Integer.parseInt(temp);
    temp = f_h.format(now);
    h = Integer.parseInt(temp);
    // Calculate all the positions of the hands
    xs = (int) (Math.cos(s * Math.PI / 30 - Math.PI / 2) * 45 + xcenter);
    ys = (int) (Math.sin(s * Math.PI / 30 - Math.PI / 2) * 45 + ycenter);
    xm = (int) (Math.cos(m * Math.PI / 30 - Math.PI / 2) * 40 + xcenter);
    ym = (int) (Math.sin(m * Math.PI / 30 - Math.PI / 2) * 40 + ycenter);
    xh = (int) (Math.cos((h * 30 + m / 2) * Math.PI / 180 - Math.PI / 2) * 30 + xcenter);
    yh = (int) (Math.sin((h * 30 + m / 2) * Math.PI / 180 - Math.PI / 2) * 30 + ycenter);
    // Refresh the image
    gIm.setColor(getBackground());
    gIm.fillRect(0, 0, dIm.width, dIm.height);
    // Draw the circle of the clock
    gIm.setColor(circle);
    gIm.drawOval(0, 0, d.width-1, d.height-1);
    gIm.setColor(hours);
    // Draw the stripes of the hours
    for(int i = 0;i<12;i++)
    sx = (int) (Math.cos((i * 30) * Math.PI / 180 - Math.PI / 2) * 47 + xcenter);
    sy = (int) (Math.sin((i * 30) * Math.PI / 180 - Math.PI / 2) * 47 + xcenter);
    sx2 = (int) (Math.cos((i * 30) * Math.PI / 180 - Math.PI / 2) * 49 + xcenter);
    sy2 = (int) (Math.sin((i * 30) * Math.PI / 180 - Math.PI / 2) * 49 + xcenter);
    gIm.drawLine(sx, sy, sx2, sy2);
    // Draw the time on the top of the clock
    gIm.setColor(digital);
    gIm.drawString(standard.format(now), 25, 30);
    // Draw the mute logo
    Mute m = new Mute(M, gIm);
    // Draw the hands
    // Seconds
    gIm.setColor(second);
    gIm.drawLine(xcenter, ycenter, xs, ys);
    // Minutes
    gIm.setColor(minute);
    gIm.drawLine(xcenter, ycenter-1, xm, ym);
    gIm.drawLine(xcenter-1, ycenter, xm, ym);
    // Hour
    gIm.setColor(hour);
    gIm.drawLine(xcenter, ycenter-1, xh, yh);
    gIm.drawLine(xcenter-1, ycenter, xh, yh);
    // Paint the generated image on the screen
    if(im != null)
    g.drawImage(im, 0, 0, null);
    if(M == false)
    play(getCodeBase(), "Sound/Click.wav");
    public void update(Graphics g)
    paint(g);
    class Mute
    Mute(Boolean mute, Graphics g)
    g.setColor(mute_logo);
    Polygon p = new Polygon();
    p.addPoint(1, 7);
    p.addPoint(6, 2);
    p.addPoint(6, 12);
    g.fillPolygon(p);
    g.drawLine(7, 5, 7, 9);
    g.drawLine(9, 4, 9, 10);
    g.drawLine(11, 3, 11, 11);
    if(mute == true)
    g.drawLine(13, 3, 1, 11);
    /* // All the mouse events
    public void mousePressed(MouseEvent evt)
    mouse_x = evt.getX();
    mouse_y = evt.getY();
    if(mouse_x <= 11 && mouse_x >= 1 && mouse_y <= 12 && mouse_y >= 2)
    if(M == true)
    M = false;
    } else {
    M = true;
    repaint();
    public void mouseReleased(MouseEvent evt){}
    public void mouseEntered(MouseEvent evt){}
    public void mouseExited(MouseEvent evt){}
    public void mouseClicked(MouseEvent evt){}
    }

    There is a gross misconception among the new and learning programmers that a lot of code is good and once you put that last close scope in place that things are wonderful because you have all the code down...
    Please repeat this: NO, short debugged runs and incremental builds are better.
    As a matter of fact, that is so important, go back and say it again and again until it really truly sinks in.
    This concept is really pounded into your soul when you program in assembler--probably an ailment of the new generation of programmers, they never have had to do assembler or machine coding--but any time you get more than about 20 lines of code that hasn't been checked for bugs, you should start thinking... "Oh, do I really have the skills and patience to go back and debug (yes, actually use the debugger to step through it all.) that big of mess?" The biggest project is just like eating an elephant, you do it one small bite at a time over as long a time as it takes--you don't cook half the elephant and sit down and expect to eat it in one meal; neither do you sit down and decide to code a whole program and then debug it. You just don't have the skill to do it.
    When you modify someone else's code, the same is true--small changes and debug as you change. Making all the changes you want, then debugging just runs into a huge error file of related problems that are basically indiscernible from each other because many of them are probably related.
    Most of the request for "Help, I cannot get this to run." Also contain the words: "I just finished coding..." That statement in and of itself is one of the great flawed concepts that anyone can have--coding is complete when you have an acceptable release candidate, and then only until you decide or are asked to make further changes.
    Work in small blocks of code and incrementally build a project--your frustration levels will be much less. And as you gain skill, increase the size of the code blocks (I had a friend in college that never had 5 consecutive lines of code compile--ever! He works for MS now.) and get to know your debugger. Your debugger is your friend, if you've not been introduced to your debugger, then get acquainted soon! Like maybe before you even try to cut another piece of code.
    On the other side of things... cheer up, we've all been there and learned the lessons... some lessons just come harder than others... make your life less frustrating, it's a lot more fun and enjoyable.

  • Error while updating account: need help with error msg

    Hi all,
    when I try to change the AccountOwner of an Account via Web Service I sometimes get the following error:
    <faultstring>Method 'WriteRecord' of business component 'Account' (integration component 'Account') for record with search specification '[External System Id] = "27446"' returned the following error:"The selected record has already been added to the list. Please add another record or close the pop-up list and continue.(SBL-DAT-00357)"(SBL-EAI-04375)</faultstring>
    Can anyone please help me to interprete this fault?
    Thanks
    Michael

    Looks like you are creating an Account Team member who already exists in the account team vs just updating the Account owner

  • Need some help with code.. No idea what's wrong! I'm new..(J2ME related)

    Hey there,
    I've just started programming J2ME using Netbeans using the java mobility pack, trying to create a program which interacts with a php webserver..
    I created some code which accessed my php script on my server and returned the contents of the page back, and successfully got it working. However, i did a bit of treaking, and then tried to remove it all.. and now my code won't work. I've been examining it for a good hour and can't seem to find the error! It's annoying me pretty badly.. I'm not liking J2ME already.
    Could someone please look at my code and help me out? I really really want to get this working..
    * VisualMidlet.java
    * Created on 26 October 2007, 19:37
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * @author Will
    public class VisualMidlet extends MIDlet{
    /** Creates a new instance of VisualMidlet */
    private Display display;
    private Command Submit;
    private Command okCommand2;
    private Command Submit1;
    private Form Form1;
    private StringItem stringItem1;
    String url = "http://people.bath.ac.uk/wal20/testGET.php?type=3";
    public VisualMidlet() {
    System.out.println("initialized");
    display = Display.getDisplay(this);
    Connect();
    public void startApp() {
    public void Connect(){
    try {getViaStreamConnection(url);}
    catch (IOException e) {
    System.out.println("IOException " + e);
    e.printStackTrace();
    public void getViaStreamConnection(String url) throws IOException {
    StreamConnection streamConnection = null; //declares a stream connection
    InputStream inputStream = null; // declares an input Stream
    StringBuffer b = new StringBuffer();
    TextBox textBox = null;
    try {
    System.out.println("Establishing stream");
    streamConnection = (StreamConnection)Connector.open(url);
    System.out.println("Stream established");
    inputStream = streamConnection.openInputStream();
    int ch;
    while((ch = inputStream.read()) != -1) {
    b.append((char) ch);
    textBox = new TextBox("Simple URL Fetch", b.toString(), 1024, 0);
    } finally {
    if(inputStream != null) {
    inputStream.close();
    if(streamConnection != null) {
    streamConnection.close();
    display.setCurrent(textBox);
    public void pauseApp() {   }
    public void destroyApp(boolean unconditional) {  }
    /** This method initializes UI of the application.
    private void initialize() {                     
    getDisplay().setCurrent(get_Form1());
    * This method should return an instance of the display.
    public Display getDisplay() {                        
    return Display.getDisplay(this);
    * This method should exit the midlet.
    public void exitMIDlet() {                        
    getDisplay().setCurrent(null);
    destroyApp(true);
    notifyDestroyed();
    /** This method returns instance for Submit component and should be called instead of accessing Submit field directly.
    * @return Instance for Submit component
    public Command get_Submit() {
    if (Submit == null) {                     
    // Insert pre-init code here
    Submit = new Command("Submit", Command.OK, 1);
    // Insert post-init code here
    return Submit;
    /** This method returns instance for okCommand2 component and should be called instead of accessing okCommand2 field directly.
    * @return Instance for okCommand2 component
    public Command get_okCommand2() {
    if (okCommand2 == null) {                     
    // Insert pre-init code here
    okCommand2 = new Command("Ok", Command.OK, 1);
    // Insert post-init code here
    return okCommand2;
    /** This method returns instance for Submit1 component and should be called instead of accessing Submit1 field directly.
    * @return Instance for Submit1 component
    public Command get_Submit1() {
    if (Submit1 == null) {                      
    // Insert pre-init code here
    Submit1 = new Command("Submit", Command.OK, 1);
    // Insert post-init code here
    return Submit1;
    /** This method returns instance for Form1 component and should be called instead of accessing Form1 field directly.
    * @return Instance for Form1 component
    public Form get_Form1() {
    if (Form1 == null) {                     
    // Insert pre-init code here
    Form1 = new Form(null, new Item[] {get_stringItem1()});
    // Insert post-init code here
    return Form1;
    /** This method returns instance for stringItem1 component and should be called instead of accessing stringItem1 field directly.
    * @return Instance for stringItem1 component
    the code for the php script is:
    <?php
    $response = "Hello";
    if (isset($_GET)) {
    switch ($_GET["type"]) {
    case 1: $response = "Good Morning"; break;
    case 2: $response = "Good Afternoon"; break;
    case 3: $response = "Good Evening"; break;
    default: $response = "Hello"; break;
    echo $response;
    ?>
    I would be grateful for any reply
    Thank you in advance
    -Will

    sorry! i'll repost the code in code format
    * VisualMidlet.java
    * Created on 26 October 2007, 19:37
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * @author Will
    public class VisualMidlet extends MIDlet{
    /** Creates a new instance of VisualMidlet */
    private Display display;
    private Command Submit;
    private Command okCommand2;
    private Command Submit1;
    private Form Form1;
    private StringItem stringItem1;
    String url = "http://people.bath.ac.uk/wal20/testGET.php?type=3";
    public VisualMidlet() {
    System.out.println("initialized");
    display = Display.getDisplay(this);
    Connect();
    public void startApp() {
    public void Connect(){
    try {getViaStreamConnection(url);}
    catch (IOException e) {
    System.out.println("IOException " + e);
    e.printStackTrace();
    public void getViaStreamConnection(String url) throws IOException {
    StreamConnection streamConnection = null; //declares a stream connection
    InputStream inputStream = null; // declares an input Stream
    StringBuffer b = new StringBuffer();
    TextBox textBox = null;
    try {
    System.out.println("Establishing stream");
    streamConnection = (StreamConnection)Connector.open(url);
    System.out.println("Stream established");
    inputStream = streamConnection.openInputStream();
    int ch;
    while((ch = inputStream.read()) != -1) {
    b.append((char) ch);
    textBox = new TextBox("Simple URL Fetch", b.toString(), 1024, 0);
    } finally {
    if(inputStream != null) {
    inputStream.close();
    if(streamConnection != null) {
    streamConnection.close();
    display.setCurrent(textBox);
    public void pauseApp() { }
    public void destroyApp(boolean unconditional) { }
    /** This method initializes UI of the application.
    private void initialize() {
    getDisplay().setCurrent(get_Form1());
    * This method should return an instance of the display.
    public Display getDisplay() {
    return Display.getDisplay(this);
    * This method should exit the midlet.
    public void exitMIDlet() {
    getDisplay().setCurrent(null);
    destroyApp(true);
    notifyDestroyed();
    /** This method returns instance for Submit component and should be called instead of accessing Submit field directly.
    * @return Instance for Submit component
    public Command get_Submit() {
    if (Submit == null) {
    // Insert pre-init code here
    Submit = new Command("Submit", Command.OK, 1);
    // Insert post-init code here
    return Submit;
    /** This method returns instance for okCommand2 component and should be called instead of accessing okCommand2 field directly.
    * @return Instance for okCommand2 component
    public Command get_okCommand2() {
    if (okCommand2 == null) {
    // Insert pre-init code here
    okCommand2 = new Command("Ok", Command.OK, 1);
    // Insert post-init code here
    return okCommand2;
    /** This method returns instance for Submit1 component and should be called instead of accessing Submit1 field directly.
    * @return Instance for Submit1 component
    public Command get_Submit1() {
    if (Submit1 == null) {
    // Insert pre-init code here
    Submit1 = new Command("Submit", Command.OK, 1);
    // Insert post-init code here
    return Submit1;
    /** This method returns instance for Form1 component and should be called instead of accessing Form1 field directly.
    * @return Instance for Form1 component
    public Form get_Form1() {
    if (Form1 == null) {
    // Insert pre-init code here
    Form1 = new Form(null, new Item[] {get_stringItem1()});
    // Insert post-init code here
    return Form1;
    /** This method returns instance for stringItem1 component and should be called instead of accessing stringItem1 field directly.
    * @return Instance for stringItem1 component
    }

  • Need info and help with ARD

    I would really like to get some information and help that would enable me to troubleshoot my mother's new Mac Mini for her. She lives in CA and I live in WA. She is new to Macs and I just KNOW there will be lots of desperate phone calls from her to me!
    I should say right up front, though, that although I do pretty well with my own Macs, I know almost nothing about THIS subject. So, please, any help or information you choose to give me, it will need to be in plain, old English as I don't understand all this stuff.
    My setup is this: (I don't know what is relevant or not) ......I have a desktop G4 running 10.4.3 that will be the computer I will use to remotely control the Mini. The Mini is also running 10.4.3 (or will be when I get it set up for her). I am connected to the internet through a wireless connection to my ISP. I have a Linksys router and connect to that via Ethernet. We have 4 other computers here at home connected to our network wirelessly.
    My Mom will connect to the internet using a modem and AOL
    This is what I have done so far but I have not been able to make a connection. (As a test, before I go to CA and setup the Mini, I thought I’d try to remotely control my iBook, which is on my network.) On the iBook, I enabled ARD in the Sharing preferences and checked "VNC viewers nay control screen with password" and then entered a password. On my desktop computer, I downloaded Chicken of the VNC, entered in the info I needed (address of the iBook and password) but it would not connect.
    I've read so much about clients, servers, etc. here lately that my head is swimming and I’m more confused than ever!
    Can I even do what I'd like? It'd sure be a sweet deal for me and avoid a lot of frustration for my Mom .......who, incidentally, is switching to a Mac from a PC at the tender young age of 75! Cool, huh? I'd really like to make it as painless for her as possible.
    Thanks,
    Kathy
    G4/dual 1.25 and iBook G4/933   Mac OS X (10.4.3)  

    The phone line speed is the BIG issue.... there are things like DynDNS that cab help with the static issue...
    now if you get her highspeed through cable...
    good luck

  • Help with code errors

    Can somebody help me get rid of the following compile errors:
    coreservlets/OrderPage.java:61: setNumOrdereed(int, int) in coreservlets.ShoppingCart
    cannont be applied to (java.lang.String,int)
    cart.setNumOrdered(recordingid, numItems);
    .\coreservlets\shoppingCart.java:44 cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\ShoppingCart.java:49: cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    itemOrder new order = new ItemOrder(Catalog.getItem(recordingid));I know that not very helpful with out the code but the code is very big so if anyone wants me to post extracts from the code please tell me.

    Thank you i put that code in but now get the following:
    coreservlets/OrderPage.java:40:  incompatible types
    found : java.lang.strgin
    required: int int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
    ^/code]
    coreservlets/OrderPage.java:48: addItem(java.lang.String) in coreservlets.ShoppingCart cannot be applied to (int)
    cart.additem(recordingid);
    .\coreservlets\AhoppingCart.java:44: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\AhoppingCart.java:49: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    ItemOrder newOrder = new ItemOrder(Catalog.getItem(recordingid));
    4 errors.
    Also could you explain what the line you added to the code means:
    !=null?request.getParameter("recordingid"):1;
    !=null?request.getParameter("numItems"):"1";and how come you got rid of if (recordingid != null) {Thanks for any help with these errors
    OK I HAVE GOT RID OF ALL THE ERRORS APART FROM THE TOP ONE:
    code]coreservlets/OrderPage.java:40: incompatible types
    found : java.lang.strgin
    required: int
    int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
                                            /code]
    Message was edited by:
            ajrobson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Borderless Window help with code please!

    I am using Dreamweaver MX 2004.
    I just cannot get my head round this Java code and would really appreciate some help or direction!
    I want to make a nice little window to show a few lines of text, with a close button or X in the corner (not fussed). I have looked at lots of tutorials and produced numerous codes to use.
    OK, fine I get that bit. My problem comes with placing the codes in the right places. I paste the HEAD portion in the head of the doc. The BODY in the body. BUT is this the doc I am going to call up with my few lines of text in, or the doc I am going to call from? Get what I mean? Also I want to call from a link and haven't had much luck with the line of code I put in the link box. I have tried lots ways and have just managed to confuse myself.
    I am not asking for someone to do it for me and believe me I have tried to work this out for myself but it's not happening for me. Please can someone explain this to me in very plain English as I am obviously some sort of delinquent!
    Thank you

    Yes I am using HTML and Javascript. So Java and Javascript are not the same thing? Right ,OK ,well that has taught me something. Don't suppose you can help me with script on this forum then. Sorry!

  • Pop accounts and .Mac with Mail system

    Iv been trying to learn how to use my iBooks 'mail' system with both my Gmail and .Mac accounts. But, keep coming up with more questions than I can find answers to.
    1. Why doesn't mail that I receive or send from my 'mail' programme show up when I go to .Mac and open the mail there? Shouldn't the mail be in both?
    2. Same question for folders that I created in both .Mac and the 'mail' system.
    3. When using the 'mail' system with POP accounts does deleting mail automatically also delete the mail in the original POP account. In other words if I have the 'mail' system set to delete POP mail for a Gmail account does that also delete the copy over in Gmail?
    Just trying to figure out how the 'mail' system works in relation to if I use .Mac. Also, in relation to Gmail. I'm learning that when I'm in .Mac things aren't quite the same.
    Thank for the help in advance.

    You can access multiple accounts with the Mail.app and each account has its own webmail access that does not reflect all mailboxes available with an email client such as the Mail.app. It is impossible for webmail access with your .Mac account to reflect your Gmail, Yahoo or any other non-.Mac account mailboxes or any user created "On My Mac" location mailboxes which are stored locally on the hard drive.
    The same when accessing your Gmail or Yahoo account via webmail access using a browser. Doing so will reflect your Gmail or Yahoo account mailboxes only.
    When logged in to your .Mac account via webmail access using a browser, it will reflect your .Mac account's inbox mailbox in Mail and any other .Mac server stored mailboxes in Mail which are located under your .Mac account named icon in the mailboxes drawer only. It will not reflect the mailboxes for any other account, any imported mailboxes or user created "On My Mac" location mailboxes.
    > Sounds like what you're saying that in order for both .Mac and my mail.app to sync they both have to be marked ".Mac account" and not "on my Mac". That way they both operate from the main Mac server. Am I heading in the right direction?
    Not exactly.
    The Mail.app mailboxes drawer includes the following in this order:
    * Inbox
    * Drafts
    * Sent
    * Trash
    * Junk (only if Junk Mail is set to automatic)
    * Smart Mailboxes (only if you have created and are using any Smart Mailboxes)
    * Imported Mailboxes (only if you have imported any mailboxes)
    * User Created "On My Mac" location mailboxes.
    * .Mac account named icon
    The Inbox mailbox for each account is located under Inbox in the mailboxes drawer regardless the account type. Open Inbox in the mailboxes drawer by selecting the black triangle beside it pointing it down to reveal the account named Inbox mailbox for each account. Selecting an account named Inbox mailbox in the mailboxes drawer reveals messages received by that account only in the message list. Selecting Inbox in the mailboxes drawer reveals a blended Inbox mailbox for all accounts.
    Your .Mac account's Inbox mailbox in the mailboxes drawer is synchronized with the server which is the same behavior with any IMAP account. Messages in your Gmail or Yahoo account's Inbox mailbox are downloaded from the server, not synchronized with the Gmail or Yahoo servers and the same with any POP account. It is impossible for your .Mac account to synchronize the Inbox mailbox for a non-.Mac account.
    Go to Mail > Preferences > Accounts and under the Mailbox Behaviors tab for your .Mac account preferences, if you don't store Drafts, Sent, Trash and Junk messages on the server with your .Mac account when using Mail, the account's Drafts, Sent, Trash and Junk mailboxes will be available under the Drafts, Sent, Trash and Junk categories in the mailboxes drawer. All account mailboxes under Drafts, Sent, Trash and Junk in the mailboxes drawer are stored locally on the hard drive.
    Open your .Mac account named icon in the mailboxes drawer. All mailboxes under your .Mac account named icon represent/refelect your .Mac account server stored mailboxes when accessing the account via webmail EXCEPT for the account's Inbox mailbox which is located under Inbox in the mailboxes drawer. If you don't select store Drafts, Sent, Trash and Junk messages on the server under the Mailbox Behaviors tab for the account preferences, besides your .Mac account's Inbox mailbox, no other mailboxes are and can be synchronized with the server except for the mailboxes located under your .Mac account named icon in the mailboxes drawer.
    When creating a new mailbox, you can select "On My Mac" as the location which is stored locally on the hard drive and will not be synchronized with the server or any server.
    Or you can select your .Mac account as the location which will create a server stored mailbox which will be located under your .Mac account named icon in the mailboxes drawer and will be available on the server (via webmail access) and kept synchronized with the server.
    No other mailboxes in Mail will be available on the server with your .Mac account via webmail access and this is the same behavior with any email client such as the Mail.app.
    > Is this something I should ring up Applecare on to make it simpler to make them match? Or would changing them all to ".Mac account" and the server solve the issue?
    Calling AppleCare will be a waste of time because your problem is a lack of knowledge and understanding only. You can't change your Gmail or Yahoo email accounts to a .Mac account with Mail or with any email client since these are separate/different accounts.

  • Removing GMAIL POP Account and Replacing with IMAP Account

    Because I want to sync my Gmail account on two Macs and discovered that IMAP is better at this than POP, I want to delete my Gmail POP account and add an IMAP account. Mail > Preferences indicates that all received mail will be deleted as well. Since I want to keep received emails, should I move them to a folder in On My Mac? I don't see where emails are stored on the hard drive, so until I know that I'll be able to retrieve them, I don't want to delete the POP account.
    Thanks,
    Nick

    Nick,
    You may find that all these messages also exist on the Gmail server, and if so they will sync with the IMAP access. The account folder and the Inbox, etc, can be found at Home/Library/Mail in a folder beginning with POP.
    You can leave the POP account, and only disable it in Mail Preferences/Accounts/Advanced until you check or transfer the info.
    Ernie

Maybe you are looking for

  • Wifi not working after upgrading to mountain lion

    As soon as I updated my MacBook Pro from Snow Leapord to Mountain Lion. My wifi doesn't turn ON. It says WIFI "No hardware found".

  • PDE-PDS001 cannot compile pu against 10g database

    Error occurs when compiling form/library 10as/10g db database version 10.1.0.2 forms version 9.0.4.0.19 also forms6i patch15 library that can be succesfully compiled against ver 8.1.7.3 and 9.2.0.3 cannot be compiled against 10g database PDE-PDS001 C

  • Simple Pricing

    Hi, I created a new condition table (for price group), created a new Access Sequence, a new Condition Type (CT) and then condition record for this CT. Now when I try creating a new Sales Order, give my material, it gives the error. Runtime Errors: SA

  • Do "Developed" jpgs need to be exported for the changes to be recognized by other viewers/software?

    I have the box checked in Catalog Preferences to include Develop settings inside jpgs. Do I have to export jpgs from Lightroom in order for other programs and photo viewers to "see" the changes I made to the jpgs in LR 5.3? Yes, I normally Develop Ra

  • Problem:  Photoshop CS6 applies two paragraph styles when one is selected

    Hi everyone, When I change the heading title within my text box, I select the heading and then select the appropriate style.  Instead of just changing the heading, the body text changes as well.  Is there a setting that's causing this to happen?  Tha