This site requires JavaScript, please enable it in your browser!
Greenfoot back
divinity
divinity wrote ...

2019/7/28

Trying create an id

divinity divinity

2019/7/28

#
hi pple it has been quite a while. i am creating a JBank, banking application in java where I am practicing at the moment but I am stuck at this: Customer IDs will start with the number 1000 and use the letters "S" (for savings), "O"(for overdraft checking), "L"(for Line of credit checking) and "I" (for investment savings) to indicate the type of account. The format of the account identification should be as follows: customersID acct type. so the first customer would hava saving account 1000S and up to three account other indentified as 1000O, 1000L, and 1000I; my question is how do I implement the IDs: 1000O, 1000L, and 1000I; without getting any error. because I have tried doing it and I am getting this error: add import javafx.scene.input.KeyCode.O; and ';' expected here is the code.
package RBL_BankATM;



/**
 *
 * @author luana
 */
public class CheckingAccount extends Account{
    
    String  custID = 1000S, 1000O, 1000L, 1000I; the error is right here(add import  javafx.scene.input.KeyCode.O; 
and ';' expected)
    
    
    
}
anyhelp would be appreciated.
danpost danpost

2019/7/28

#
First, you cannot mix alpha characters with numeric character outside of double quotes (to make them strings). Second, you cannot list multiple things under the same field name (custID) -- unless it is an array or list. Third, those listed items on line 11 appear to be account ids, not customer ids (maybe the field name should be changed). Fourth, the listed values are not all checking accounts. I do not know why you would put them all in a class called CheckingAccount (probably should be in Account class).
You need to login to post a reply.