Thanks.
I did read it but I never found the part about converting to a String....
User Profile
Collapse
-
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...Leave a comment:
-
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...Leave a comment:
-
Ok, I'm on it. But did you see any thing else wrong with my code?...Leave a comment:
-
I am not sure what you mean by API documentation. As you may tell, I'm pretty new to this stuff....Leave a comment:
-
[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? ");...Leave a comment:
-
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... -
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....Leave a comment:
-
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...Leave a comment:
-
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...Leave a comment:
-
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:
***
**
... -
-
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...Leave a comment:
-
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.*;...
No activity results to display
Show More
Leave a comment: