# Search:

Type: Posts; User: Scorks

Page 1 of 3 1

1. ## Thread: Algorithm for card sorting

by Scorks
Replies
1
Views
227

### Algorithm for card sorting

I need to find an algorithm to sort a deck of cards with THREE rules.

1. We can only look at the top 2 cards on the scrambled deck.
2. We may flip the two cards around if we wish
3. The top card...
2. ## Thread: Algorithm for permutations

by Scorks
Replies
2
Views
200

### [SOLVED] Re: Algorithm for permutations

I got it pretty soon afterwards. Thanks anyways.
3. ## Thread: Algorithm for permutations

by Scorks
Replies
2
Views
200

### [SOLVED] Algorithm for permutations

Consider the problem of generating all permutations of length k of a set of cardinality n, where n is a non-negative integer number and k < (or) = n is a non negative integer number.

So far, I...
4. ## Thread: Time complexity problem?

by Scorks
Replies
0
Views
128

### Time complexity problem?

2674

Hi all,

I was wondering if anyone could answer a sample question from the full question here? I understand that big-OH is the worst case, little O is the best case, and Theta notation is...
5. ## Thread: I/O stream question?

by Scorks
Replies
7
Views
223

### Re: I/O stream question?

Oh, okay! So the whole purpose for streams is just because these files can be large, and using bytes helps shorten it down. Where exactly is this information going when we use streams, though?
6. ## Thread: I/O stream question?

by Scorks
Replies
7
Views
223

### I/O stream question?

Hey, just a basic theory question that the text isn't doing a fantastic job of explaining. I know that java I/O streams are used for reading/writing bytes, as opposed to the system.in and system.out...
7. ## Thread: How to make buttons in JFrame and when clicked on, do something?

by Scorks
Replies
2
Views
125

### Re: How to make buttons in JFrame and when clicked on, do something?

You need to create ActionListeners. Basically, these listeners will be attached to your buttons, and when they're pressed, the code provided in the listener class will be executed. For example, when...
8. ## Thread: using ActionListeners to draw circles

by Scorks
Replies
4
Views
233

### Re: using ActionListeners to draw circles

Well, x,y, and r are just the values that the user would input into the JTextFields, then upon clicking the "draw" button, I want a circle to be drawn. I just don't know how to actually invoke the...
9. ## Thread: using ActionListeners to draw circles

by Scorks
Replies
4
Views
233

### using ActionListeners to draw circles

Hey there,

We're learning GUI, and I'm working on a program that takes the input of x, y, and radius, and draws a circle from those points.

I'm stuck, because in my listener, I'm not sure how...
10. ## Thread: Order of growth

by Scorks
Replies
1
Views
298

### Order of growth

Hi!

We recently started Time complexity/order of growth in my computer science class, and we were given a table with a number of different order of growth definitions ((O)N^2, O(N^3), O(N!),...

by Scorks
Replies
1
Views
399

### exponent recursion

The question is:

The following method was known to the ancient Greeks for computing square roots. Given a value x > 0 and a guess g for the square root, a better guess is (x + g/x) / 2 (g + x/g) /...
12. ## Thread: Exiting array loop

by Scorks
Replies
3
Views
242

### Re: Exiting array loop

I'll try that, thanks!

by Scorks
Replies
4
Views
263

### Re: Arrays?

Thanks! That cleared it up. My code is getting incredibly convoluted though, and I'd rather have everything separated into their own classes. The question is:
Airline seating. Write a program that...

by Scorks
Replies
4
Views
263

### Arrays?

I have the code:

public class main {

public static void main(String[] args) {

//ARRAY for first class
15. ## Thread: Exiting array loop

by Scorks
Replies
3
Views
242

### Exiting array loop

Hey there!

I'm working on specific method (reserve a plane seat), and I have created a 2D array to represent the seats. here is the method so far to reserve a seat in economy class:

public...

by Scorks
Replies
1
Views
275

### boolean arraylists?

Hey there!

I'm working on an airline reservation system, and have decided to use boolean 2D arraylists to store my seating information. There is first and second class, but I have forgotten how to...

by Scorks
Replies
4
Views
401

### Re: Inheritance question!

It's not my code... it's directly from a textbook.

by Scorks
Replies
4
Views
401

### Re: Inheritance question!

1import java.util.Scanner;
2
3/**
4 This program shows a simple quiz with two choice questions.
5*/
6 public class QuestionDemo2
10 ChoiceQuestion first = new ChoiceQuestion();
11...

by Scorks
Replies
4
Views
401

### Inheritance question!

Hey there! I have a question involving the code below. The question is:

Which methods does the ChoiceQuestion class inherit from its superclass? Which methods does it override? Which methods does...
20. ## Thread: Where is my .class?

by Scorks
Replies
8
Views
167

### Re: Where is my .class?

All I have is the Shapes.java file, then four others called AnObject.class, ACircle.class, ACircle\$ARectangle.class, and ACircle\$ATriangle.class on their own.
21. ## Thread: Where is my .class?

by Scorks
Replies
8
Views
167

### Re: Where is my .class?

public class ATriangle extends AnObject {

double Side1;
double Side2;
double Side3;

//No parameter constructor

public ATriangle() {
double Side1;
22. ## Thread: Where is my .class?

by Scorks
Replies
8
Views
167

### Re: Where is my .class?

I did that, and now I'm getting the same problem, except now it happens with ARectangle aswell.
23. ## Thread: Where is my .class?

by Scorks
Replies
8
Views
167

### Re: Where is my .class?

That's the problem! When I try to look for ATriangle.class, all that comes up is ACircle\$ATriangle.class and ARectangle\$ATriangle.class, but none are just ATriangle.class ...
24. ## Thread: Where is my .class?

by Scorks
Replies
8
Views
167

### Where is my .class?

Hi! I've just finished writing a program, and I keep getting an error stating

Shapes.java:308: cannot find symbol
symbol : class ATriangle
location: class Shapes
ATriangle ATriangle = new...
25. ## Thread: .toString method question!

by Scorks
Replies
6
Views
335

### Re: .toString method question!

Sorry, here's the code I'm working with:

class ARectangle extends AnObject {

double Width;
double Length;

//No parameter constructor
Results 1 to 25 of 53
Page 1 of 3 1