User Profile

Collapse

Profile Sidebar

Collapse
NoviceJava
NoviceJava
Last Activity: Apr 18 '08, 07:05 PM
Joined: Mar 1 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • NoviceJava
    replied to Bubblesort
    in Java
    Thanks.

    I did read it but I never found the part about converting to a String....
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Bubblesort
    in Java
    Oh, I also created a new a new selection sort method:
    [HTML]
    public static int[] sorting(int vals[])
    {
    for (int i = 0; i < vals.length; i++)
    {
    int index = i;
    for (int j = i+1; j < vals.length; j++)
    if (vals[j] > vals[index])
    index = j;

    int largerNumber = vals[index];
    vals[index] = va...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Bubblesort
    in Java
    I tried this:

    System.out.prin tln(Arrays.toSt ring(sorting(mk rand)))

    but I got the error message saying that it cannot find symbol
    symbol: variable Arrays...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Bubblesort
    in Java
    Ok, I'm on it. But did you see any thing else wrong with my code?...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Bubblesort
    in Java
    I am not sure what you mean by API documentation. As you may tell, I'm pretty new to this stuff....
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Bubblesort
    in Java
    [HTML]
    import java.io.*;

    public class Bubble
    {
    public static void main(String[] args)
    throws java.io.IOExcep tion
    {
    String s1, convert;
    int i, num;

    InputStreamRead er isr = new InputStreamRead er(System.in);

    BufferedReader br = new BufferedReader( isr);

    do
    {
    System.out.prin t("How many random numbers? ");...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    started a topic Bubblesort
    in Java

    Bubblesort

    hello,

    I am having trouble with a program. It seems easy, but for some reason I am just not getting it. I need to create an array of random numbers and call a bubblesort method that I create myself. I then need to print the sorted array. I created the random array but I cant seem to figure out the sort method, which needs to follow in descending order. This is what I have:

    [CODE=java] public static int[] sorting(int...
    See more | Go to post
    Last edited by Killer42; Apr 13 '08, 02:19 PM. Reason: Added CODE=java tag

  • NoviceJava
    replied to Creating a Pattern Assignment
    in Java
    Thank You. I now see. So first comes the space and then the input, along with the corresponding amount of stars. The input is then decreased by one and a new line is then printed whereby the decreased amount of stars follows the same process until it reaches 1. At least I think I've now got it....
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Creating a Pattern Assignment
    in Java
    I know the difference between the methods; println returns a new line after completing while print prints subsequent information on the same line. I played around with many different things and this is what I ended with

    while (num != 0)
    {
    total = total + star;
    System.out.prin t(total);
    System.out.prin t("");
    num--;
    }

    When imputing 9 I get the required...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Creating a Pattern Assignment
    in Java
    I tried this and it is giving me the output

    *
    *
    *
    *
    *
    *
    *
    *
    *
    This is what I typed:
    while (num != 0)
    {
    System.out.prin tln(star);
    num--;
    }

    when I also try:
    while (num !=0)
    {
    total = total + star;
    System.out.prin tln(total);
    num--;
    }

    I get the same...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    started a topic Creating a Pattern Assignment
    in Java

    Creating a Pattern Assignment

    Hey,

    I'm having trouble with an assignment and I need some help.

    basically, the assignment is the same as the from the following link:
    http://www.thescripts. com/forum/thread607498.ht ml

    However, there is one major exception: The pattern is reversed. Here is what it looks like:
    If the user types "3", your program should produce the following output:
    ***
    **
    ...
    See more | Go to post

  • NoviceJava
    replied to Very Simple Calculator Program Help
    in Java
    Thanks, this worked....
    See more | Go to post

    Leave a comment:


  • NoviceJava
    replied to Very Simple Calculator Program Help
    in Java
    I'm not sure what you mean. The code above is what I have worked on so far. When I try to compile it I get an error message saying that the variable result may not have been initialized.

    I am expecting it to read "What do you want to compute," whereby I need to input the expression in the required format mentioned previously and for it to give me the result after reading "The result is." The expression only...
    See more | Go to post

    Leave a comment:


  • NoviceJava
    started a topic Very Simple Calculator Program Help
    in Java

    Very Simple Calculator Program Help

    I'm new to JAVA and need some help writing a simple calculator program.

    Here are the instructions:

    -expects espression with 2 operands together with either +, -, *, or / operator
    -espects only positive input
    -assumes all real #'s
    -assumes operands and operators in expression are separated with spaces

    here is what I have so far:

    import java.io.*;
    import java.util.*;...
    See more | Go to post
No activity results to display
Show More
Working...