*HELP* searching scrambled list in Visual C++

dstone2323

Newcomer
Joined
Oct 3, 2005
Messages
6
i am a beginning computer science major and have completed only 1 cs class so i do not know hardly any functions in c++. i am enrolled in discrete math and have been given a huge project by my teacher. he has given me a list of letters {tdunlpaahsedeorstarrointnigrnremmlutaitemrenclduhispgoioejsttqawdrstuiauiaepeywdtys}. we then are supposed to take this list and figure out which of (Tool) the band's songs these letters make. we have to look up all of the bands songs and then make a program to figure out which songs are in the list. we must use all of the letters once and only once. i am going to be using visual c++ to write the code, but i have to have it done pretty quick so i may not be turning anything in if i cant figure out how to do this. thank you for any help anyone could give me. feel free to email me at dstone2323@hotmail.com if you need to for anything, thank you
 
let me make sure i understand what you are saying

your input will be something like:
gnihtaerbdnagnitaewsmi <---(this is the below text done backwards)

the above text will obvoiusly be scrammbled like you suggested. and you have to write a program that takes gnihtaerbdnagnitaewsmi and does a compare with each character, and can only use each character once, to every song by tool until all letters from gnihtaerbdnagnitaewsmi and all letters from the lyrics below are used up. is that correct?


the first 2 lines of sweat are:
I'm sweating,
and breathing
 
yes that is correct, just on a larger scale. all of the tool songs are options and he did tell us that it is about 10 or 11 songs in the list i described earlier. i will add a post with the exact problem to show you. it is stretched out pretty long so i may have to split it up.
 
The Concept:
Imagine you have found a contest where if you can solve the following puzzle, you will be entered into a drawing
to win a pair of front row tickets to a concert. Being a ‘nerd’ to the highest degree, you determine that it would be
easier to write a program to solve the puzzle, instead of trying to figure it out by hand!

The Puzzle:
You are given a collection of letters. Out of these letters, you must reconstruct the names of songs from the band
for which you are trying to win tickets to go see. You must use all of the letters in the collection, many of which
appear more than once, once and only once. (The song titles come from official releases only and spaces do not count
as a letter, so remove them from the titles of the songs......

The Approach:
Since we have a collection of letters, we can take all of the unique letters and call that our alphabet. As an
example, if there are 12 letters used, then the total number of letters in U would be 12, even if there were 200 letters
in the collection total.
Once you have all the alphabet, you decide to scour the internet to find all the song titles by the artist in question.
Of course, some of those song titles will contain letters and other characters which are not in your alphabet. You
can disregard those. The rest you must include.
It is now up to you to try to design a program or algorithm which will solve the problem!

The Contest:
You have been long awaiting the release of Tool’s new album, due out this fall. Coinciding with the release of
the album will be a mini-tour. Tickets will sell out in less than 30 seconds at each of the few small venue shows
scheduled. You have one hope, and that is to win the contest and hope not too many others get the correct answer,
making your chances of winning the drawing even higher!

The Collection:
Below is the list of letter from names of Tool songs which appear on an official album. Remember that spaces
are not included below, so if a title of a song was ‘Three Word Song’, it is now called ‘threewordsong’.

tdunlpaahsedeorstarrointnigrnremmlutaitemrenclduhispgoioejsttqawdrstuiauiaepeywdtys
 
You could simply count hte occurence of each letter in the original list of letters, then given a song name you could just count the number of times each letter crops up and compare against the original list - if they list contains the same or greater number of letters then the song name is in there.
If you have a more specific question then feel free to ask - however nobody here is just going to do your assignment for you...
 
well we have been told that it could be done like ur talking about but the deal is, i have no idea how to do it. i dont even know how to do arrays and i know that that is how u have to do it. like list the letters total value in an array for the alphabet and then for each song list the values in array and then somehow compare them to each other using nested for loops. but all of this is greek to me having just learned how to cin the height and width to cout the area and perimeter of a box. but the teacher doesnt care if i know how to do it, he just wants it done. he is allowing us to get into groups of 2 or so to do this, but there are only 2 people in the entire class that have any hope of getting it done and they haven't gotten it yet, and everybody in the class is kissing their butts trying to get them to let them put their names on the paper with them, so thats why i just figured i'd try it on here, but it looks like i'm just going to get griped at by people like u that accuse me of strictly outsourcing my work. the reason i havent been trying to get my paper off of those 2 guys is because i WOULD like to have the satisfaction of writing my own, even if it came from somebody on here, but just where i could look at it and understand how everything works. i would love to someday be able to sit and write programs like this off the top of my head, but as of now i am nowhere even close. so if anyone could help in any way, i'd be very greatful. and if ur going to try and gripe at me for asking for help, just keep your comments to yourself
 
I'm sure this is too late for the project you were working on, but maybe it can help you with your next project.

Try looking for tutorials such as this one to help you with the basic sytanx problems you are having ("i dont even know how to do arrays"). I found this with a simple google search: c++ tutorial. Once you know the basics (through chapter 3 of the posted tutorial) I think you'll have a much easier time getting what you need from this forum and from programming in general.
 
Back
Top