Need some java help - arrays

I've been learning java for the past few weeks and I'mstuck with the following question:
Write a short program to store the input values of a user-specified amount of whole numbers and output them in a multipcation matrix form, with correct formatting.
For example, the input of of three numbers 1, 2 and 3 would produce the followinf matrix:
*1 2 3*
*2 4 6*
*3 6 9*
or the input of 4 numbers 3,7, 4 and 9 would produce the following matrix:
*3 7 4 9*
*7 49 28 63*
*4 28 16 36*
*9 63 36 81*
whereby the inner numbers in the grid represent the product of the number on the corresponding top row and left most column, i.e 36 = 9 4*
The user must be initially be allowed to specify how many numbers they wish to enter, followed by the number themselves. You must maked use of an array for this exercise. Ensure the proper formatting rules are adhered to, i.e. that all columns are aligned vertically (right justified). You can assume no input number greater than 100 will be entered.
I was wondering if someone could help me with this?

Or better yet:
[] 3  7  4  9
3  9 21 12 27
7 21 49 28 63
4 12 28 16 36
9 27 63 36 81which is i am sure what you were after flounder, the formatting for some reason kept moving the top row over to the left.
P.S. If the OP is still here...here is a bit of a head start.
public static void main(String[] args) {
       Scanner sc1 = new Scanner(System.in);
       int[] array;
       int x;
       int y;
       System.out.println("How many numbers do you want to enter? ");
       x = sc1.nextInt();
       array = new int[x];
       System.out.println("Please enter your numbers ");
       for (int i=0;i<x;i++){
           y = sc1.nextInt();
           array=y;
//test printing contents of array
System.out.println("--------------");
System.out.println();
System.out.println("OUTPUT");
System.out.println();
System.out.println("--------------");
for(int j=0;j<array.length;j++){
System.out.print(array[j]);

Similar Messages

  • I need some Java inspiration

    Maybe because I'm running on empty, waiting for lunch, but I'm not feeling inspired.
    So, I need some Java inspiration. What was the last Java-"thing" (anything, from a coding trick, to a class, package, tool, etc...) that made you say "giddy-up!"

    > super cool stuff.
    Another example from the book, but I'll write the Java-equivalent first.
    List list = Arrays.asList(
        Arrays.asList(1, 0),
        Arrays.asList(0, 1, 2)
    Collections.sort(list, new Comparator() { // sort by first element
        public int compare(Object o1, Object o2) {
            List list1 = (List) o1;
            List list2 = (List) o2;
            Integer a = (Integer) list1.get(0);
            Integer b = (Integer) list2.get(0);
            return a.compareTo(b);
    List expected = Arrays.asList(
        Arrays.asList(0, 1, 2),
        Arrays.asList(1, 0)
    assert list.equals(expected);Here's the Groovy equivalent:
    def list = [ [1, 0], [0, 1, 2] ]
    list = list.sort { a, b -> a[0] <=> b[0] } // sort by first element
    assert list == [ [0, 1, 2], [1, 0] ]Oh, and I'm with duffymo. Spring is a blast.
    ~

  • Need some quick help - fairly urgent!

    I've just taken over a new job and have been the task of finishing the new brochure for Christmas, there's not a lot to do but a lot of the measurements need changing
    This is the layout I'm dealing with..
    All the boxes have been made in Illustrator
    The text has been done in In'Design and it seems every piece of text is it's own box if that makes sense
    My question is, if I select the whole specification box - copy, paste it into Adobe Illustrator and change the text there, then paste the edited box back into In-Design, will I lose quality when it gets printed?
    I'm worried if I do it this way it may come out blurred? Or am I just worrying about nothing?

    I couldn't find an Illy file in the end and have ended up creating tables in ID to replicate what was already there!
    Didn't take very long and I guess if I didn't do it now, I'd come across the same situation next time!
    Date: Wed, 30 Nov 2011 08:48:07 -0700
    From: [email protected]
    To: [email protected]
    Subject: Need some quick help - fairly urgent!
        Re: Need some quick help - fairly urgent!
        created by Peter Spier in InDesign - View the full discussion
    There certainly are viable "quick fix" solutions proposed here, and if the dealine is looming and this file never needs to be touched again I might be tempted, but they are only postponing the pain for a file that needs periodic updates, and I wouldn't waste effort on them, myself, when that time can be put toward a proper rebuild now if that's the ultimate goal.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4054725#4054725
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4054725#4054725. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in InDesign by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • I need some help adding music to my slideshow in iPhoto.  When I open iTunes as the source, it says it needs to be open to populate, which it is.  I have no knowledge of computers...like, at all....so I need some (simple) help?  If possible?  Thanks.

    When I open iTunes as the source, it says it needs to be open to populate, which it is.  I have no knowledge of computers...like, at all....so I need some (simple) help?  If possible?  Thanks.

    When I open iTunes as the source, it says it needs to be open to populate, which it is.  I have no knowledge of computers...like, at all....so I need some (simple) help?  If possible?  Thanks.

  • When trying to use my webmail service it says i need some java to run reply to the emails.  i am using an iPad iOS 6.1.3

    when trying to use my webmail service it says i need some java to run reply to the emails.  i am using an iPad iOS 6.1.3
    what do i hve to do to be able to use my webmail ?

    Java is not supported on iPads. Does your provider have a non-Java version or have their own app, or could you use the Mail or a third-party email app for it ?

  • Remember me.....well i need some real help now....:)

    Hello guys,i hope that u remember me...if not i hope that u ll help me anyway....
    well,i had an assignment for my university...i posted it and u told to start reading several books and try to write some code....
    i came up with the following code:
    import java.util.Random;
    import java.util.*;
    import java.text.DateFormat;
    class Account {
         double initbal;
         double deposit;
         double withdraw;
    //Account constructor
    Account() {
         initbal=0;
         deposit=0;
         withdraw=0;
    //method for calculating the balance
    double balance() {
         return (initbal+deposit)-withdraw;
    class BankAccount {     
         double initbal;
         private double deposit;
         private double withdraw;
         public static void main(String args[]) {
         Account Dimitris=new Account();               //call the constructor
         CurrentAccount Over=new CurrentAccount();
    try {     //exception added for fault parameters
         Dimitris.initbal=Double.parseDouble(args[0]);     //string parsing into a double
         Dimitris.deposit=Double.parseDouble(args[1]);     //string parsing into a double
         Dimitris.withdraw=Double.parseDouble(args[2]);     //string parsing into a double
         } catch (ArrayIndexOutOfBoundsException e) {
              System.out.println("You must enter three values!!");
         } catch (NumberFormatException e) {
              System.out.println("Only numbers are allowed!!");
         double AvlOvr;
         double bal;
         bal=Dimitris.balance();          //method called
         System.out.println("Initial balance is: "+Dimitris.initbal);
         System.out.println("Deposit Amount is: "+Dimitris.deposit);
         System.out.println("Withdraw amount is: "+Dimitris.withdraw);
         System.out.println("Overdraft limit is: "+Over.AvlOvr);
    if (withdraw>(initbal+deposit)) {
         System.out.println("Insufficient Funds");
    else
         System.out.println("Balance is: "+bal);
         System.out.println("Available Funds is: "+(bal+Over.AvlOvr));
         //display the date and time for the current locale     
         Date date=new Date();
         DateFormat dateFormatter=DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);
         System.out.println(dateFormatter.format(date));
    class CurrentAccount extends BankAccount {
    private float accId;
    double AvlOvr;
    CurrentAccount() {
    double ovdr;
    ovdr=100;
    AvlOvr=ovdr;
    interface Personal {
    void Deposit ();
    void Withdraw ();
    the thing is that i need some help cause i cant find some sollutions....
    i d like to give to the user a random id....
    then at the CurrentAccount subclass i d like to add a Username to the user.Then Level 2 worries me as well.....I ll post u my assignment so u can have a look....If u could help me with Level 2 sollution and the thing that i told u before i d be grateful.......
    by the way..i hope that u all guys have nice holidays!!!
    Here is the assignment:
    JAVA LAB ASSIGNMENT � B241
    Bank Account
    Level 1
    Create a bank account that reads in the following information about a single customer
    account:
    Initial balance
    Deposit amount
    Withdraw amount
    Current Date
    Give the account holder a random account id number.
    Display error messages if the number of parameters is incorrect or negative parameters are
    entered.
    Verify that the amount being withdrawn is available (i.e. make sure that the initial balance +
    deposit amount is greater than or equal to the amount being withdrawn).
    Calculate the balance amount in the account after the transaction has been completed.
    Tasks:
    - Create a BankAccount class, which defines a bank account
    - Use command line arguments to read in the account information
    - The customer account values are private and accessible only through the
    BankAccount class
    - Use the file, InsufficientFundsException.java given to you (Location:
    /global_ro/rekha/B241/assignment) to create an Exception class called
    InsufficientFundsException.class that throws an exception if an
    InsufficientFundsException occurs in your BankAccount class. Make the necessary
    changes to the file if you feel the need to do so.
    - Print out the following information:
    2
    account holder�s id
    balance amount
    amount being withdrawn
    the current date and time
    (Hint: this will occur when the amount withdrawn is more than the total amount in the
    account. Your withdraw method throws the InsufficientFundsException exception which
    should be caught in your main program from where you are calling the withdraw method).
    Subclass the BankAccount class for the specifics of a CurrentAccount class that adds an
    additional field to the already existing information:
    User name
    The account balance and account id values should still be private and now accessible only
    through the CurrentAccount subclass.
    Allow the CurrentAccount class to provide overdraft protection of up to �100.
    Task:
    - Incorporate the additional functionalities into your initial program and print out the
    values as before.
    ********************************END OF LEVEL 1 **************************
    Level 2
    Add the following functionalities to your Level 1 program.
    Define an interface named Personal, consisting of two methods:
    Deposit
    Withdraw
    Read in the account information specified in Level 1 for more than one user through the
    command line parameters and display appropriate error messages as before.
    Calculate the balance amount in each account after the transaction has been completed.
    Tasks:
    - Increment the account id each time a customer is added (For instance, if the first
    customer id is 100, the next id should be 101 and so on).
    - Implement the Personal interface in the BankAccount class.
    - Print out the customer information for all customers as you did in Level 1.
    *****************************END OF LEVEL 2*****************************
    Level 3
    Extend the above features to add some more personal information about the customer such
    as:
    a. Name: surname first name
    b. Date of birth: day/month/year
    c. Address: street
    Town
    Postcode
    d. Phone: home number work number
    e. E-mail: e-mail address
    Customer�s data is stored in a file. It is retrieved from the file when the bank is opened and
    stored in a memory buffer. The memory buffer is updated after every transaction. The
    contents of the memory buffer are written into the file when the bank is closed.
    Design a data management structure of the bank with several customers. The bank performs
    �deposit� and �withdraw� transactions by using Java I/O streams.
    Use the SimpleClient.java and SimpleServer.java files (Location:
    /global_ro/rekha/B241/assignment) as a base for creating your own Client and Server
    windows. Make the necessary changes to the files for them to work within your programs.
    Tasks:
    - Create a non-graphical user interface to be able to
    o enter customer�s data
    o display customer�s personal and account data after every transaction
    - Write a JAVA program to read and write customers data from/to a file.
    - Create a client � server networking environment using Java�s networking capabilities
    such that data is entered through the server window and displayed by the client in the
    client window.

    Ela re si k eimaste k sinonomatoi...anyway...could you pleaze help me with my assignment...my other problem is that i've writen some more code for the 3rd part where it says add some more fields for the customers.I save them in a file and i restore them but i dont know how can i call them when the bank is opened....here's the rest of the code....
    import java.io.*;
    public class UserInfo {
    public static void main(String[] args)
    throws IOException {
         String k,l,m,n,o,p,q,r;
    BufferedReader stdin = new BufferedReader(
    new InputStreamReader(System.in));
    System.out.print("First name:");
         k=stdin.readLine();
         System.out.print("Last name:");
         l=stdin.readLine();
         System.out.print("D.O.B:");
         m=stdin.readLine();
         System.out.print("Address:");
         n=stdin.readLine();
         System.out.print("Town:");
         o=stdin.readLine();
         System.out.print("Postcode:");
         p=stdin.readLine();
         System.out.print("Phone:");
         q=stdin.readLine();
         System.out.print("E-Mail:");
         r=stdin.readLine();
         try {
    DataOutputStream out = new DataOutputStream(
    new BufferedOutputStream(
    new FileOutputStream("Data.txt")));
         out.writeUTF(k);
         out.writeUTF(l);
         out.writeUTF(m);
         out.writeUTF(n);
         out.writeUTF(o);
         out.writeUTF(p);
         out.writeUTF(q);
         out.writeUTF(r);
         out.close();
         DataInputStream in = new DataInputStream(
    new BufferedInputStream(
    new FileInputStream("Data.txt")));
         System.out.println(in.readUTF());
    System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         System.out.println(in.readUTF());
         } catch (NumberFormatException e) {
         System.out.println(e);
    }

  • Replaced zd8000 motherboard and need some troubleshooting help please............

    Hello All,
     I just replaced the motherboard on our HP zd8000 (pentium 4, 3.0ghz, 2gb ram, Win XP) with a used but tested good MB and need some help with the following.
    1) I now cannot play DVD movies as the error no "dvd decoder" present which was not an issue before?  Where can I go to get a free decoder that will work, as Windows only shows paid versions?  We have the dvd burner/reader with lightscribe. SOLVED! CNET HAD DECODER.
    2) The internal temperature, according to SpeedFan, is running around 140 degrees with just some Internet browsing.  Is that a normal temperature because I only have one of three fans running on the laptop?  Is there anyway of making all three fans run to be sure there are no issues?  I am positive I hooked up everything but again only one fan seems to be running?
    3) I discovered some of the pins were damaged in the card reader.  I may get the Seller to give me a discount, no intention of tearing it apart simply for that, but is there any concern of short or otherwise?
    4) Our battery stopped charging years ago, these were notorious for such, but I purchased a new one last year and hoped the replacement MB would allow charging again.  No such luck though.  Is there anything I can do, BIOS update etc, to make the battery charge?
    5) Anything you folks can think of for me to test to insure the new motherboard is working properly?
    Thanks, Ralph 
    P.S. This was a correct replacement board according to MB serial numbers.  Everything else seems to be functioning properly other than mentioned.  Our graphics went out on the original MB.
    This question was solved.
    View Solution.

    Some of the wires had pushed out of the harness that connected the other two fans.  I double checked and re-attached those so now the laptop is running quite a bit cooler.
    EVERYTHING IS GOOD TO GO!

  • Newbee in j2me needs some starter help

    Hi,
    I am a newbee in j2me and need a starter help.
    My aim is work on mobile applications/services and for that what stuff I need. I have already downloaded wireless kit. Does I require some additions softwares and what?
    Can I find tutorials and starter help and from where?
    Thanks in anticipation.
    Regards,
    Navin.

    You can refer to article 'Think small with J2ME at' -
    http://www-106.ibm.com/developerworks/wireless/library/wi-j2me/
    It shows by example deployment of a sample application using wireless toolkit.
    Manish.

  • GT70 680m/8970m troubleshooting - need some experienced help!

    Hi!
    Looping for some serious help...
    After some erratic behavior my i7 3rd gen GT70 just stopped working with MSI 680m 4GB. The card shows on occasions in manager, but both - discrete and HD4000 have no installed drivers and wont work unless 680 is plugged out (then intel kicks in without prob). That happened after some automatic driver updates and possibly BIOS update. Tried a ton of these and Bioses, rather randomly, trying to solve the disappearance of my 680m from control panel, but non of them worked. To make the things worse, I've messed with EC firmware editions trying the "beta" t25,21,16,17 - one of them bricked the lappi for good... Had MSI re-flash the bios (couldn't do the blind flash myself) but they say they can't help me with 680 since it is from GT60 originally and it's not supported by GT70 (I switched it from 675 to 680 in the other MSI laptop some 8 months ago - both worked without a problem until the issue). Don't have access to check my 680m in another MSI to check if it's working and is no hardware failure, but have access to 8970m from CLEVO for some decent bucks - was wondering which bios should I install to run it in my GT70 or which bios/EC firmware to flash so my old 680 start working again... This or that... Any idea? Guys? Svet? Sure will make the donation if needed of course!
    J

    Quote from: pjaca on 12-April-15, 13:56:25
    Checked that out. What I need is some info which BIOS to use in GT70 0ND for 680m or 8970m, particularly. My 680m stopped working after the bios/ec firmware update, still shows in manager but tries to the same resources as integrated Intel HD resulting in both not working. Is there a bios that allows for permanently switching off optimus and integrated gpu? Or the bios that will accept radeon 8970m (that works perfectly in 2nd gen MSI gt780 by the way...). Any ideas?
    No special BIOS is required to support 680M. Just use the latest BIOS release for model GT70 0NE by MSI, it should be working on the machine as long as there is no other strange issue, like a malfunction VGA card/Mobo....

  • My ipod is majorly screwed up and i need some serious help

    k well lets see
    error states 'can't mount ipod'
    so i tried checking all the wires, restoring the ipod (which didnt work because it couldnt find it) and i scanned all my files for viruses.
    my ipod also makes funny clicking noises when i dont even touch it...
    im just a kid guys.. i need some serious ipod whizz to help me out.. im desperate! ive tried everything

    Hi,
    Firstly please try to deal with "can't mount iPod" issue
    http://docs.info.apple.com/article.html?artnum=93499

  • I need some serious help with Oracle Database....PLEASE!!

    I am using Microsoft Virtual PC 2007 that has Oracle Database 10g and Wondows XP installed on it.
    Database instance is DOWN but that is not the problem
    Listener is UP
    Agent Connection to Instance is DOWN, and I cannot get this running!
    How can I fix this problem? I am not an expert, but I have been trying for a long time to fix this issue, but I can't. It just came to the point that I want to grab my pc and throw it across the room.
    Error message: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)
    Here is my LISTENER.ORA file:
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    Here is my TSNNAME.ORA file:
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    Once again, I am not an expert, so please try to explain it as simple as possible...I know, I am an idiot when it comes to networking issues.
    if you guys need some more information, just let me know!
    Thank you!

    What I mean is that I can get the Instance UP with no problem, but the Connection with the Instance is the problem.
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl service
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:38
    :06
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1002 state:ready
    DISPATCHER <machine: PAOLOSCAMARDELL, pid: 2576>
    (ADDRESS=(PROTOCOL=tcp)(HOST=paoloscamardell)(PORT=2307))
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:52
    :03
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 25-NOV-2009 11:50:27
    Uptime 0 days 10 hr. 1 min. 39 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\oracle\product\10.2.0\db_1\network\admin\listener.o
    ra
    Listener Log File C:\oracle\product\10.2.0\db_1\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.109)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>

  • Getting Started with Podcasting - need some direction/help

    hi,
    I need some information on how to get started Podcasting. Any good online resources, software, etc.
    I have looked at garageband3 on my iMac and it seems to be quite good, but what else is out there and does anyone have any tips or suggestions on getting started?
    Thanks in advance!!
    BCA

    I still have GB 2 so I don't know about GB's podcasting abilities (though some of the questions I see here suggest it's not all that wonderful).
    I use, and would recommend, Podcast Maker:
    http://www.potionfactory.com/podcastmaker/
    which is $29.95 and is available on a 30 day free trial.
    You make your podcast using GB or whatever program you want, and save it as an MP3 file. You then open it in Podcast Maker and add the summary and description fields, and if you want it to be an enhanced podcast you add chapters and the artwork. It will then upload it to your iDisk or the server of your choice, create the XML file, and ping the Apple Store if required. All this is seamless and easy to use.

  • I'm new to java and I need some quick help with NetBeans.

    Hi. To whomever can help here's the problem. I've been trying to install netbeans ide 5.0 on my computer for a while now and i can't seem to find out what is wrong. I'm in a java programming course and i need the J2SE Developement Kit 5.0 Update 7 and NetBeans IDE 5.0 Installer on my comp. Whenever i go to install it, it can't automatically create a directory and has erroe null in place of it. Whenever i made a new directory for it a page would come up telling me all of the errors during the installation which are null. Since i have administrator privelages and plenty of free space on my hardrive.

    Hi,
    I want to suggest you that
    1.please check if any prerequisite is require before installing the NetBeans IDE,i hope there is nothing like that except proper jdk on your machine.
    2.if you already having JDK on your machine check for the compatibility of that jdk version with the required NetBeans IDE version.
    3.follow the steps provided to install the NetBeans IDE 5.0 for that refer the below link
    http://www.netbeans.org/community/releases/50/install.html
    hope you will get rid of the problem .....
    ---Vidya

  • Need some urgent help with Java code...

    Hello
    i am taking a java class..beginner..and i am a dud at programming...
    had a couple of questions ..how do make a program ignore negative
    integer values,make it terminate when zero is entered instead of a number ,how should i calculate maximum minimum of integers..please help me..
    thanks
    damini

    You got some good advice from Java_Jay.
    Here is a snippet I keep handy for console input and output. It doesn't do your home work but gives you a working example of getting numbers from stdin:
    import java.io.*;
    public class DemoKeyboardInput {
         public static void main(String[] args) throws IOException {
              // open keyboard for input (call it 'stdin')
              BufferedReader stdin = new BufferedReader(new InputStreamReader(
                        System.in), 1);
              // get input from the keyboard
              System.out.print("Please enter your name: ");
              String name = stdin.readLine();
              System.out.print("Please enter your age: ");
              String s1 = stdin.readLine();
              System.out.print("Please enter the radius of a circle: ");
              String s2 = stdin.readLine();
              // perform conversions on input strings
              int age = Integer.parseInt(s1); // string to int
              double radius = Double.parseDouble(s2); // string to double
              // operate on data
              age++; // increment age
              double area = Math.PI * radius * radius; // compute circle area
              // output results
              System.out.println("Hello " + name);
              System.out.println("On your next birthday, you will be " + age
                        + " years old");
              System.out.println("Area of circle is " + area);
    }

  • Some java help needed!!!!

    Exception in thread "main" java.lang.NullPointerException
         at Standings.<init>(Standings.java:15)
         at Client.main(Client.java:21)
    this is my program and I dont understand what is going wrong, I am also including the 2 classes that complement it.
    class 1
    public class Team
    // Declaring Private Variables
    private double wins;
    private double loses;
    private String Name;
    public Team()
         Name="";
         wins=0;
         loses=0;
    public Team(String t, double w, double l)
         Name=t;
         wins=w;
         loses=l;
    public void setName (String n)
         Name=n;
    public void setWins (double w)
         wins=w;
    public void setLoses (double l)
         loses=l;
    public String getName ()
         return Name;
    public double getWins ()
         return wins;
    public double getLoses ()
         return loses;
    public String toString ()
         String toString=Name + " " + wins + " " + loses;
         return toString;
    public boolean equals (Team p1, Team p2)
         if ((p1.Name.equals(p2.Name))&&(p1.wins==p2.wins) && (p1.loses==p2.loses))
              return true;
         else
              return false;
    class 2
    public class Standings
    private Team [] teams;
    private String [] steams;
    public Standings (Team [] arr)
         for(int i=0;i<arr.length;i++)
              teams[i] = new Team(arr.getName(), arr[i].getWins(), arr[i].getLoses());
    public Team [] toString2 ()
              return teams;
    client program
    import java.text.DecimalFormat;
    import java.util.Scanner;
    import java.io.File;
    import java.io.IOException;
    public class Client
    public static void main( String [] args ) throws IOException
         //first let's create an array of football teams
         Team [] array = new Team[5];
         array[0] = new Team("Alabama", 6, 6);
         array[1] = new Team("Georgia", 7, 4);
         array[2] = new Team("Tennessee", 8, 3);
         array[3] = new Team("Vanderbilt", 4, 8);
         array[4] = new Team("Mississippi", 1, 6);
         // now instantiate the team calling the overloaded constructor
         Standings temp = new Standings(array);
         // now let's print the team (call toString)
         System.out.println(temp.toString());
    //Standings another = new Standings( temp );

    private Team [] teams;You never allocated this array, as in:
    teams = new Team[size];
    so when you get to this line:
    teams[ i ] = new Team(...);teams is null, ergo the NullPointerException.

Maybe you are looking for

  • How do i transfer apps from an old iphone to a new one?

    How do you transfer content (apps, pictures, etc) from an old iPhone 3 to a new iPhone 4s?

  • Change in PO after payment

    Hi friends, I have a situation where, one of the PO has been posted to GL account instead of assets. User MIRO,MIGO and Payment has been already done and check has been sent to vendor already. What would be the ideal situation to change the accounts

  • Java and ABAP Stack

    Hi All, I am still not clear about role/function of java and abap stack in XI. Can anybody explain?

  • Make detail items in master/detail form read only

    I want to make detail items in master/detail form read only for certain conditions (master STATUS = Closed). I see how to do this on the master record items but not on detail items.

  • IPhoto crashes on opening

    the message follows: Check with the developer to make sure iPhoto works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X. I've done all that Click Repo