Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube Google+
Results 1 to 3 of 3
  1. #1
    Junior Member MaxG's Avatar
    Join Date
    Jul 2008
    Posts
    18
    Downloads
    0
    Uploads
    0

    java problem???? can some one help me??? im a newbie?

    int gra[] = new int [10];
    String out1="";
    String out2="";
    String out3="";
    String out4="";
    System.out.println("BAR CHART");
    System.out.println("Please input grade of: ");
    for(int x=0;x<gra.length;x++){
    System.out.print("Student"+(x+1)+":");
    gra[x]=Integer.parseInt(br.readLine());

    if(gra[x]<=99 && gra[x]>=96)
    out1+="*";
    else if(gra[x]<=95 && gra[x]>=91)
    out2+="*";
    else if(gra[x]<=90 && gra[x]>=85)
    out3+="*";
    else
    out4+="*";
    }
    System.out.println("**************************");
    System.out.println("Grade Chart: ");
    System.out.println("96-99:"+out1);
    System.out.println("91-95:"+out2);
    System.out.println("85-90:"+out3);
    System.out.println("Below 85:"+out4);









    what do you mean by this java statement???(out1+="*")????


    can someone explain???


    youre answers will be of great help...thanks

  2. #2
    Junior Member Atmey's Avatar
    Join Date
    Jun 2008
    Posts
    4
    Downloads
    0
    Uploads
    0
    It adds the * (star) to the string out1.
    out1 = ""
    out1+="*"
    out1+="*"
    out1+="*"
    //this would make the out1="***"

  3. #3
    Junior Member deonejuan's Avatar
    Join Date
    Nov 2008
    Posts
    21
    Downloads
    0
    Uploads
    0
    once a String variable has been initialized, you can keep adding to it...

    String s; // not init
    String w = ""; is init

    w += "x";
    w += " ";
    w += "one two three and more."
    s = "";
    s += "see";


Similar Threads

  1. Java Newbie Question?
    By Why Know in forum Introductions
    Replies: 3
    Last Post: 05-24-2011, 06:12 AM
  2. please help this newbie in java programming.?
    By Sherwin Roy in forum Introductions
    Replies: 0
    Last Post: 11-18-2010, 11:16 AM
  3. Java Eclipse Newbie(FNG)?
    By Just wondering in forum Introductions
    Replies: 0
    Last Post: 09-02-2010, 04:17 PM
  4. Replies: 0
    Last Post: 10-24-2009, 03:07 AM
  5. Java Newbie. I need help?
    By ronghui lu in forum Introductions
    Replies: 1
    Last Post: 10-16-2009, 03:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 03:13 AM.
Powered by vBulletin® Version 4.2.5
Copyright © 2024 vBulletin Solutions Inc. All rights reserved.