Results 1 to 7 of 7
Thread: two questions
- 03-25-2012, 09:54 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 3
- Rep Power
- 0
two questions
hey, how're u guys?
my instructor gave us an assignment and i really tried so hard but i couldn't write the codes well :/
the first task is about an IntegerSet class and the second about drawing a cube
here's the test class
public class IntegerSetTest {
public static void main(String[] args) {
IntegerSet s = new IntegerSet();
System.out.println(" s = " + s);
s.addElements(2);
s.addElements(20, 10, 100);
s.addElements(13, 20);
System.out.println(" s = " + s);
IntegerSet s1 = new IntegerSet(0, 3, 6);
s1.addElements(12, 20, 2000, 30, 31, 32, -11);
System.out.println(" s1 = " + s1);
IntegerSet s2 = new IntegerSet(10, 3, 16, 11, 21, 33, 99);
System.out.println(" s2 = " + s2);
if(s2.isElement(11))
System.out.println(" 11 belongs to s2");
else
System.out.println(" 11 does not belong to s2");
IntegerSet s3;
s3 = s1.union(s);
System.out.println(" s1 Union s = " + s3);
s2 = s1.intersection(s);
System.out.println(" s1 Intersection s = " + s2);
s2.addElements(2, 11, 7, 1100);
System.out.println(" s2 = " + s2);
s2.removeElement(20);
System.out.println(" s2 = " + s2);
}
}
and here's the outputs pic

or u can download them from here http://www.mediafire.com/?5c1vm7g0i5jv0s5Last edited by h_a25; 03-25-2012 at 10:06 PM.
-
Re: two questions
- 03-25-2012, 10:29 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 3
- Rep Power
- 0
Re: two questions
well not really but the first task i should write IntegerSet class makes the IntegerSetTest class works and give the output in the pic icontains a constructor takes ellipsis parameter and the functions addElements, union and intersection
and the second task i should write a program to draw a cube like the one showing in the pic
-
Re: two questions
- 03-25-2012, 10:54 PM #5
Member
- Join Date
- Mar 2012
- Posts
- 3
- Rep Power
- 0
Re: two questions
thank u Fubarable
wish someone else can help me :D
-
Re: two questions
We'd love to, but you've yet to ask an answerable question, and without a question, all this thread will consist of will be you expressing your frustration and us telling you that there's nothing we can do. No one is of course going to do this for you, and we'd love to help explain things and clarify misconceptions, but we have no idea where your problem is, what you understand, what you don't understand, etc. If you're totally lost, please look over this link -- So, You Need to Write a Program but Don't Know How to Start
- 03-26-2012, 11:33 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Re: two questions
That cube drawing doesn't look like it's a perspective projection; if it's an orthogonal projection it's easy: draw two squares and four lines between the corner points. For that set problem you can use a Set<Integer> or a BitSet (the API documentation is your friend).
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
3 questions
By silverglade in forum New To JavaReplies: 11Last Post: 05-09-2011, 03:17 PM -
questions regarding XML
By Sparky in forum New To JavaReplies: 4Last Post: 02-01-2011, 07:10 PM -
I have 2 questions =P
By santa in forum New To JavaReplies: 4Last Post: 01-19-2011, 05:35 PM -
Questions
By Csharks in forum New To JavaReplies: 8Last Post: 01-19-2011, 04:11 AM -
questions for 1yr exp
By rahaman.athiq in forum Java ServletReplies: 2Last Post: 11-26-2008, 01:13 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks