/    Sign up×
Community /Pin to ProfileBookmark

College project

Hello!
This is my first post on this forum.
I have a big problem. I have a java college project that sounds like this:
I am given a set of 20 numbers (integers). I must make all combinations of 20 numbers by 5 ( e.g. 1,2,3,4,5 ; 1,2,3,4,6 so on ) into a file. This i did.

Now comes the hard part.
I must make program that inputs the file with all combinations and filtrate them by another inputed file that contains multiple sets of 5 numbers.

Example.
Input first file: numbers.txt (all combinations)
Input second file : sets of numbers.txt
Filtrate buttons
Export filtrated file.

Let’s say that second file consist of 2 sets of numbers:
1,2,3,4,5
1,4,7,8,9

The program now reads the 2 sets and makes another 2 sets of numbers:

Level 1

Set1: 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
Set2: 1,2,3,4,5

Level 2

Set1: 6,10,11,12,13,14,15,16,17,18,19,20
Set2: 2,3,5,7,8,9
Set3: 1,4

I know that you understood the resulting sets construction: on level 1, the first set is from numbers that are not common to first set of numbers in the second file; on level 2 the numbers are exactley the first set of numbers from second file. On level 2 … and set3 is for numbers that appeard from the combined 2 sets of numbers in the second file.

Now comes even a harder part.
The program must visualy show all levels and all sets of numbers like this

Level ____Set1 __ Set2 __ Set3 __ Set4 …
_
______ Min Max Min Max Min Max Min Max
__
1 _
____2 __5___0 __2
__2 _____2 __5___0 __1__0___1

The above is the FILTERING. The problem sounds loke this: Eliminate the combinations from the first file that do not match the criteria ( the conditions) :

On level 1 from Set1 eliminate the combinations that do not match from 2 to 5 numbers in the set
from set2 eliminate the combinations that do not match from 0 to 2 numbers in the set

If the Filtering was

Level ____Set1 __ Set2 __ Set3 __ Set4 …
_
______ Min Max Min Max Min Max Min Max
__
1 _
____0 __ 0__5 __5

then the resulted file would contain only 1 combination : 1,2,3,4,5.
I must manualy input the condition filtering on the level sets.

Please. I realy need this for my project. I must give the project the day after tommorow and i can’t get no help from my class mates or my teacher. Thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ExplosiveHippoJan 26.2011 — This is the JavaScript forum. You need to visit the Java forum for help.
Copy linkTweet thisAlerts:
@myrelaauthorJan 26.2011 — Doh me!!!

I didn't go on the forum index page and i supposed this is the mix. Sorry.

I will post it on the Java forum. But if someone could replay here i will not mind.

Thanks.
×

Success!

Help @myrela spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...