Using an ArrayList - I can't get size() to work

Hello,
I am using an ArrayList to store customers and info. I am trying to use the size method to determine the number of elements in the list. I keep receiving the following message in the Bank.class:
C:\Documents and Settings\Administrator\Application Data\Java Homework\InProgress\Bank.java:82: cannot resolve symbol
symbol : method size ()
location: class Customer[]
          for (int i=0; i<customers.size(); i++)
^
1 error
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I would appreciate any help that you can offer.
Below is the code:
// Driver.java
import java.util.ArrayList;
public class Driver
// Stores and modifies a list of band members.
public static void main (String[] args)
          Bank myBank = new Bank();
          String name = "Elvis";
          String num = "3034874454";
          double bal = 100.00;
          int account = 0;
          myBank.addCust(name, num, bal);
          myBank.custDep(name, num, bal);
          myBank.custWth(name, num, bal);
          myBank.accrueInt(name, num, bal);
          myBank.prtCusts(account);
} // end of driver class
// Author: JB
// Bank.java
import java.util.ArrayList;
public class Bank
{          // Begin Bank Class
// Stores and modifies a list of band members.
     double trans = 5.00, rate = .1; // Set a trans amount for testing
     int Array_Size = 30;
     String cname, cnum;
     double cbal;
     Customer[] customers = new Customer[Array_Size];
     public void addCust(String CName, String PNum, double Bal)
//     public void addCust()
     {     //     Begin Add Customer method
          customers[0] = new Customer();
          customers[0].setCustomerName(CName);
          customers[0].setPhoneNumber(PNum);
          customers[0].setBalance(Bal);
     } // End
     public void custDep(String CName, String PNum, double Bal)
     {  // Begin   **  add a customer for testing of update
          customers[0] = new Customer();
          customers[0].setCustomerName(CName);
          customers[0].setPhoneNumber(PNum);
          customers[0].setBalance(Bal);
          Customer customer = customers[0];
          customers[0] = new Customer();
          customers[0].setCustomerName("Elvis");
          customers[0].setPhoneNumber("Goodyear");
          double bal = customer.getBalance();
          double new_dep = bal + trans;
          customers[0].setBalance(new_dep);
     }     // End
     public void custWth(String CName, String PNum, double Bal)
     {  // Begin   **  add some customers for testing
          customers[0] = new Customer();
          customers[0].setCustomerName("Elvis");
          customers[0].setPhoneNumber("3034897874");
          customers[0].setBalance(5600.25);
          Customer customer = customers[0];
          customers[0] = new Customer();
          customers[0].setCustomerName("Elvis");
          customers[0].setPhoneNumber("Goodyear");
          double bal = customer.getBalance();
          double new_dep = bal - trans;
          customers[0].setBalance(new_dep);
//          System.out.println ("Number of accounts " + customers.size());
     }     // End
     public void accrueInt(String CName, String PNum, double Bal)
     {  // Begin   **  add some customers for testing
          customers[0] = new Customer();
          customers[0].setCustomerName("Elvis");
          customers[0].setPhoneNumber("3034897874");
          customers[0].setBalance(10.00);
          Customer customer = customers[0];
          customers[0] = new Customer();
          customers[0].setCustomerName("Elvis");
          customers[0].setPhoneNumber("Goodyear");
          double bal = customer.getBalance();
          double new_dep = bal * (1 + rate);
          customers[0].setBalance(new_dep);
     }     // End
     public void prtCusts(int account)
          System.out.println("Customer Listing");
          for (int i=0; i<customers.size(); i++)
                    Customer customer = customers;
                    String cpn = customer.getPhoneNumber();
                    String cn = customer.getCustomerName();
                    double bal = customer.getBalance();
                    System.out.println(cn + " " + cpn + " Balance:" + bal);
} // End of class
import java.util.ArrayList;
public class Customer
private String CustomerName;
private String phoneNum;
private double balance;
public String getCustomerName() {
return CustomerName;
public void setCustomerName(String CustomerName) {
this.CustomerName = CustomerName;
public String getPhoneNumber() {
return phoneNum;
public void setPhoneNumber(String phoneNum) {
this.phoneNum = phoneNum;
public double getBalance() {
return balance;
public void setBalance(double balance) {
this.balance = balance;
Thank you,
JB

customers is declared as an array; there is no method
called size() associated with arrays. Try
customers.length.rgairns
I suppose I should have said that to begin with. You certainly took the direct approach.
thanks
walker

Similar Messages

  • I have all my music under my user id.  i would like for my wife to have access under her user id.  i tried using Home Sharing but can't get it to work.

    i have all my music under my user id.  i would like for my wife to have access under her user id.  i tried using Home Sharing but can't get it to work.

    http://support.apple.com/kb/HT3819 homesharing
    http://support.apple.com/kb/TS2972 troubleshooting home sharing.
    i <3 Homesharing. I enabled it at home, and where I work I use a mac so I enabled it on that computer as well so I can listen to my own music library while on breaks/lunch =)

  • My bank uses FinanceWorks.  I can't get it to work on my MAC which uses 10.10.2 Yosemite

    I just upgraded my iMac to yosemite 10.10.2.  Now the app my bank uses, FinanceWorks, doesn't work.  Anyone know how to fix this?  Thank you!

    I work for Digital Insight, the digital banking vendor that your bank works with to provide you with access to FinanceWorks.  Just to be sure, are you using Safari as your web browser when trying to access FinanceWorks? If so, the upgrade to Yosemite likely changed your browser settings in Safari, specifically for cookie handling.  The easiest work around is to go to the “Manage Money” tab in your Online Banking,  control-click one of the FinanceWorks options (Account Overview or Trends), and choose to open in a new tab.  From then on (until you clear your browser history or cookies), FinanceWorks should work normally within the tab.
    Also of note, Digital Insight was divested by Intuit in 2013 and is now owned by NCR. 

  • Why does my Flash addon crash repeatedly when I access sites to use video chat? Can't get camera to work most of the time. Adobe sent me HERE.

    When using video chat sites like Stickam my Adobe Flash plugin (latest version) crashes continuously. Never does with Internet Explorer. Allowing websites to access my CAM and MIC with latest version of Firefox rarely is successful. ADOBE sent me HERE. Said the problem is your crappy browser.

    When using video chat sites like Stickam my Adobe Flash plugin (latest version) crashes continuously. Never does with Internet Explorer. Allowing websites to access my CAM and MIC with latest version of Firefox rarely is successful. ADOBE sent me HERE. Said the problem is your crappy browser.

  • TS4268 I can't get iMessage to work on this device.  Help

    I had an iPhone 4. Recently moved out of service area using iPad 2. Can't get iMessage to work. Keeps saying message not sent
    Help. This is my only contact with my boyfriend and I'm in a foreign country

    iMessage not sending - Settings>Messages>Show Subject Field. Make sure it's set to "Off".

  • Have entrourage and want to use Mail. Can't get it to work.

    I had a macbook and purchased the Microsoft office for Mac which included Entrourage.
    I have now purchased a new macbook Pro and want to begin to use Mail rather than Entrourage. 
    I have Entrourage on my new computer but i can't get it to transfer my information to the the Mail program
    I am on Charter.net at my office and sbcglobal.net at home.
    How can i get this to work.  I can receive on Mail, but i can't send.

    check your outgoing port settings and make sure it's using a specific port and not the default port, also you might want to check to see if it is using SSL, TLS or any other encryption.  Verify the setting from your old machine setup.

  • Have an airplay enabled AV Receiver - how do i set up Airplay    I have a Yamaha RX-V673 which is Airplay enabled, but i can't get Airplay to work either on my Mac book or my iphone. The receiver is connected to my network and i can control it using the

    have an airplay enabled AV Receiver - how do i set up Airplay
    I have a Yamaha RX-V673 which is Airplay enabled, but i can't get Airplay to work either on my Mac book or my iphone. The receiver is connected to my network and i can control it using the iphone App and via the web browser option.
    Do I need Apple TV or to change some settings somewhere?
    Any help would be greatly appreciated

    You are making some progress with setup of wireless network. Apparently there is reliability problem with the wireless connection. Perhaps you want to refer to following Apple support documents and start tweaking parameters in the router to improve the reliability. I used to have third-party routers such as Belkin and Netgear but switched to Apple Airport routers (Time Capsule then Airport Extreme for now) because of incompatibility issues whenever Apple upgrade Mac OS X. But since Apple develops Airplay protocol as alternative to Bluetooth for wireless audio/video streaming (with much better bandwidth) and must be deployed in any wireless network, there is no reason third-party routers not working for Airplay protocol.
    About AirPlay Mirroring in OS X Mountain Lion:
    http://support.apple.com/kb/HT5404
    iOS: Recommended settings for Wi-Fi routers and access points:
    http://support.apple.com/kb/HT4199
    Troubleshooting AirPlay and AirPlay Mirroring:
    http://support.apple.com/kb/TS4215
    Good luck in setting up 802.11 wirelesss network.

  • My dock disappears when I am using Word. How can I get it back on the screen?

    My dock disappears when I am using Word.  How can I get it back on the screen?  Thanks very much.
    Bill

    You may have blundered into "Full Screen" mode, an abomination ported from iOS, the iPhone Operating System, land of tiny screens and one-at-a-time Applications.
    Try clicking the double-arrows in the extreme upper right of the MenuBar or Window.

  • I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    Oaky, at least we got that far.  Next step is to determine if all those "numbers" are really numbers.  Changing the format to "number" doesn't necessarily change the string to a number. The string has to be in the form of a number.  Some may appear to you and me as numbers but will not turn into "numbers" when you change the formatting from Text to Number. Unless you've manually formatted the cells to be right justified, one way to tell if it is text or a number is the justification. Text will be justified to the left, numbers will be justified to the right.
    Here are some that will remain as strings:
    +123
    123 with a space after it.
    .123

  • Using airport extreme in china - can't get it to work

    I just moved to china and have been trying to set up a new Airport Extreme dual band to my high speed internet connection but can't get it to work (bought the AE in the US and worked fine there). I have a Green light on the physical AE, and in Network Status section under Network Diagnostics I get green lights on Airport, Network Settings and ISP, but yellow/red on Internet and Server. The type of internet connection is direct, supplied by China Telecom with no router/modem in my unit, but with ethernet cable running directly to the phone room connection. I manually set up the AE using the same IP address, subnet, DNS as shows up when I plug the ethernet cable directly into my computer, with the internet working fine with a direct connection to computer and no AE.

    What you did makes complete sense Mike, but if you don't have access to the router you may have to get your ISP to recognize your Extreme's MAC address:
    AirPort Base Station: ISP provisioning may prevent Internet connection via broadband (cable or DSL)
    For example: Suppose that you have a computer connected to a cable modem before purchasing an AirPort Base Station. Your Internet service provider might recognize your computer's MAC address as the correct one for your account. Your new base station then takes the position on your network that was formerly occupied by your computer, but you have not taken any action to let your Internet service provider (or its hardware) know the new address. The base station then sends packets to your Internet service provider that do not contain the required MAC address, and the packets are ignored.
    It may be as simple as leaving everything disconnected from your service provider for a period of time. You might also try turning Connection Sharing "off" (bridge mode).

  • Can i use hdmi output to tv, and also thunderbolt to hdmi tv?  I basically want to use 2 hdmi tbs, but so far I can't get it to work but I feel it should

    I have a HDI cable to my monitor, works fine.  I just got a thunderboly to HDMI adapter to connect to my TV.  I can't get it to work.  I think this is possible.   

    Yes, you can have tow HDMI monitos using what you said,

  • Can't get Themes to work for movie using iMovie on ipad

    I finsished a trailer using iMovie on my iPad successfully and LOVED it! Sooo fun!
    Now I'm trying to make a movie for a friend's wedding, but I can't get it to work with the themes. When I select my theme and start a new project using a few pictures the theme music works when I replay, but no visual elements of the theme I selected show up (or available for selection). when I click on the gear wheel, it does show what theme I selected.... What am I missing???? The only place the theme shows up is on the tile in the "projects" section.
    Then I tried the same thing on my iphone 4S (iOS7) and the same thing happens.
    I looked at the tutuorials etc...and I think Im doing it right (after all, I got the trailer to work perfectly) and I think I'm not technologically challanged - but I just would like to have the theme visual elements to show up.
    Please help
    Mir

    Tap the Transition points and choose the star icon.  This is for theme associated transitions including their graphic elements.

  • Has anyone used reMIDI as a plug-in for GarageBand. I downloaded a trial version of reMIDI, which enables MIDI instruments to be strummed or arpegiated, but can't get it to work in Garageband.  How do I set it up?

    Has anyone used reMIDI as a plug-in for Garageband ('08)? The program allows MIDI instruments to be strummed or arpegiated. I have a trial version, but can't get it to work in Garageband. Wonder how to set it up.
    Thanks, Doctor Mark

    Port Forwarding.....or Port Mapping....as Apple calls it is a difficult and complex configuration method for most users. Because there are so many variables involved in this type of setup, it is not possible to provide a step by step guide that will work for everyone with all devices.
    It is possible that a setup guide exists for the the WD drive and AirPort Extreme, but you will have to go looking for it on the Internet. Even if you find one, it may not be tailored to your specific situation or needs.
    Sometimes, you can do everything right....at least according to someone's article or "how to" guide, and things still will not work correctly.
    In situations like this, when you really don't know what to do, you need to enlist the aid of an IT pro, who will know what to do based on your particular products and unique circumstances. Sometimes....they won't be able to get things working either due to particular circumstances.
    But, before you do this, I would strongly recommend that you use a Static IP address for your Internet connection with your ISP. If you do not have this now, contact them to ask them if they offer this type of connection. Expect to pay more for this type of service, of course.

  • After years of owning all things Mac, I am finally trying to use iChat, and can't get it to work. I see my buddy, but all I can do is send a message--the video and audio chat icons are gray, as is inviting to a video chat under Buddies.

    After years of owning all things Mac, I am finally trying to use iChat, and can't get it to work. I am using gmail, and I see my buddy (no camera icon next to her name), but all I can do is send a message--the video and audio chat icons are gray, as is inviting to a video chat under Buddies. My buddy has the same problem as I.  We are able to do video chat through gmail, but I had hoped to use iChat.  I am using OS 10.6.8, iChat v. 5.0.3.  What am I missing?

    HI,
    iChat will Video chat to another iChat in a Jabber Buddy List (Google run a Jabber server for GoogleTalk)
    However it will not Video to the Web Page login to iGoogle or the Web Mail Page login.  (where people can Google Chat as it were in a  Web Browser).
    Nor does it video to the Google Talk Stand alone app for PCs or any other Jabber apps on any platform.
    iChat uses a connection Process called SIP (Session Initiation Protocol) which is also used by other VoIP devices.
    Jabber/XMPP invited the Jingle Protocol for Jabber Applications.
    Google have included this in their Standalone app and the Plug-in for Web Browsers on both PCs and Mac (you can get this as a Standalone Plug-in or as part of Chrome)
    More on this here  This article has been changed several time in the recent months.  It now claims a greater involvement by Google in writing the Jingle Library (Although now Google's version does not work with the others)
    This tends to mean that using the web Login to Google to Chat also cannot video chat to other Jabber apps that are using Jingle.
    If your Buddy is using iChat then check the Video Menu has two items to Enable Camera/Video chat and Microphone/Audio chats are ticked.
    In the View Menu the Show Status Items should be ticked (Selecting them toggles the tick and the function On or Off)
    It could be Internet speed but at this stage I would doubt this at this stage.
    10:27 PM      Saturday; January 21, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • HT1152 All this help info tells me to use idvd, but I can't get it to open.  I asked the applecare guy and he says the new macs don't include idvd any more, so why do all the menu and help items say to use it?  I know there's other dvd burner software, wh

    I want to burn my imovie to a dvd.  All the help info says to use idvd but I can't get it to open.  The applecare guy said idvd is no longer included in new macs, so why are all the instructions still saying to use it?  Is one of the other software offerings, like dvd Cfreator for Mac, ok to use for this?  What's the best one?

    Please clarify what you mean by "you can't get it to open". Is iDVD on your system or not? If this is a new iMac, iDVD is no longer bundled with new Macs, so the application just isn't there and hence of course can't be opened. You can still purchase it as part of the retail iLife '11 box, though, if you want it, and it would be less expensive than DVD Creator (which I have no experience with), even though you'll get some redundant applications.
    Regards.

Maybe you are looking for

  • My Mac Mini keeps ejecting my blank DVD -R, I don't know why.

    I have never tried to use this function of my mac before, but I bought the type of DVD listed in Finder under DVD and every time I put it in there it comes back out! Help!

  • Track AP OU information in GL

    Hello all, Is it possible to transfer OU name from AP to GL reference field by using SLA. Please advise me to track that. Thanks and Regards, Muthu

  • Transaction Launcher starts popup in Background

    Hi, i´m using the transaction launcher to start a external URL in the CRM WebUI. I selected to option "Statefull" which means the transaction launcher opens a popup. That works fine so far. But the popup always starts in the background. Which means i

  • Blackberry Desktop Software Installation Problem

    I had a problem with Roxio Media Manager continuously wanting to reinstall.  So I fixed that problem and and uninstalled the Blackberry software. I then tried to re-install the Blackberry Desktop software so I can syncronize my contacts on my home co

  • "Edit Content" feature not working

    A bit of background: I own and operate a meal planning service. I use a combination of MS Office (Word, Power Point, and Excel) and Acrobat XI Pro to create my meal plans. I create the template designs in MS Office, then I convert them to PDF in Acro