# Search:

Type: Posts; User: Elyril

Page 1 of 3 1

1. ## Thread: Odd and Even numbers with boolean?

by Elyril
Replies
4
Views
437

### [SOLVED] Re: Odd and Even numbers with boolean?

Nevermind.. I got it. Sorry, I was just being stupid and lazy for that last one.
2. ## Thread: Odd and Even numbers with boolean?

by Elyril
Replies
4
Views
437

### [SOLVED] Re: Odd and Even numbers with boolean?

Alright, so I changed it to:

private static boolean iseven(int number) {
if(number % 2 == 0) {
iseven = true;
}
else {
iseven = false;
}
3. ## Thread: Odd and Even numbers with boolean?

by Elyril
Replies
4
Views
437

### [SOLVED] Odd and Even numbers with boolean?

Okay, so I'm trying to figure out how to determine if an integer is even or odd by using a boolean method. I think I have the method right, but it's calling the method into the main that has got me...
4. ## Thread: Exchanging between classes and methods

by Elyril
Replies
3
Views
161

### Re: Exchanging between classes and methods

The assignment says to have both methods in both classes, but I'm confused on how to assign variables to each of the methods. There's no compiler messages yet because I'm getting stuck on how to...
5. ## Thread: Exchanging between classes and methods

by Elyril
Replies
3
Views
161

### Exchanging between classes and methods

Hey! So, I'm in serious need of help. It should be simple, but I'm over thinking this and need help. It's a program due tonight. I need to create a Dog class that represents a dog. Then, there are 2...
6. ## Thread: Find the lowest number

by Elyril
Replies
2
Views
298

### [SOLVED] Find the lowest number

I have to find the average, highest, and lowest numbers in an array. I already have the average and highest, and I thought I could find the lowest number the same way I found the highest, but it's...

by Elyril
Replies
5
Views
247

### [SOLVED] Re: Continue statement?

Thanks for that, but how would I change the word 'time' like in box#3 to 'times' if more than 1?

by Elyril
Replies
5
Views
247

### [SOLVED] Re: Continue statement?

Sorry, thought I changed it back to the original. This is what I had before.

for(int j = 1; j <= 100; j++) {
if (allNum[number] == 0) {
continue;
}
if...
9. ## Thread: Printf not working?

by Elyril
Replies
4
Views
398

### [SOLVED] Re: Printf not working?

Sorry, meant to put it in...

Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '.2f'
at java.util.Formatter.format(Unknown Source)
at...

by Elyril
Replies
5
Views
247

### [SOLVED] Continue statement?

I read on how to use the continue statement, but I'm failing in how to use it properly, mostly because it's not working. I'm supposed to print out what numbers are showing up and how many times for...
11. ## Thread: Printf not working?

by Elyril
Replies
4
Views
398

### [SOLVED] Printf not working?

I need to print to 2 decimal places and I'm trying to use the printf method, but for some reason I keep getting an error. I've looked through my code, but unless I'm missing a small detail, it looks...
12. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

Alright, I mostly got this.. except, that I'm not sure I'm using continue in the right way. And it's also not printing out 'times' if there's more than 1 count of a number. But this is what I have...
13. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

Alright, so I have it mostly working now. But, now I'm trying to make it so that when I print out the concurrences, that if there was more than 1 of a number, that it would print out 'times' instead...
14. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

Is the array for storing the amount of each number then? And yes, it's a college assignment. I added and changed a couple things, but I can't test it because I'm not sure how to make it so that the...
15. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

I have no idea what the number of elements is because the user can input any amount of numbers they can want as long as they don't enter 0 which ends the input. And that <101> initialization of...
16. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

I've been reading and correct me if I'm wrong, but do I have to use an <arrayList>? Because from what I've been reading, you HAVE to initialize the array to some kind of limit. And for the <number>...
17. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

The loop terminates when the last number inputted is a 0, so that's why I put the <number != 0> in the loop.
18. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Re: Counting input array

Oh wow, I'm dumb.. Thanks! I should think a lot more... So, how would I initialize that variable since I have to use it in the for loop and also as a user input?
19. ## Thread: Counting input array

by Elyril
Replies
17
Views
663

### [SOLVED] Counting input array

Hey, so I have to take user input and then count how many times each number that the user input and print each one out. For some reason, I can't even get the for loop statement to print and it's...
20. ## Thread: Printing a matrix

by Elyril
Replies
7
Views
452

### [SOLVED] Re: Printing a matrix

Ah. Got it! Thanks! and I didn't copy all the }s, so that's why they seemed out of place.
21. ## Thread: Printing a matrix

by Elyril
Replies
7
Views
452

### [SOLVED] Re: Printing a matrix

Ah.. I see. I thought that was how it was supposed to be, but I kept doubting myself. and now this is my code

public static void printMatrix(int n) {
//first loop = rows, second loop = columns...
22. ## Thread: Printing a matrix

by Elyril
Replies
7
Views
452

### [SOLVED] Re: Printing a matrix

This is what I have for my method <printMatrix>. I'm not sure how to make it so that the input can be used in the method. Also, not sure if both for loops should have n as the variable.

public...
23. ## Thread: Printing a matrix

by Elyril
Replies
7
Views
452

### [SOLVED] Printing a matrix

Please help.. I have an assignment that states that we have to print out a matrix of random 0s and 1s, the size of n-by-n with n coming from user input. With that being said, I know I have to use...
24. ## Thread: Counting and Math.random

by Elyril
Replies
30
Views
680

### [SOLVED] Re: Counting and Math.random

Yes, I hope so too. I should also take it slow and think. Thank you again
25. ## Thread: Counting and Math.random

by Elyril
Replies
30
Views
680

### [SOLVED] Re: Counting and Math.random

Thank you so much! I feel like my head was going to explode...
Results 1 to 25 of 58
Page 1 of 3 1