![]() |
|
#1
|
|||
|
|||
Need help with Simple 1D Array coding projectHello out there. i have a c++ project dealing with simple 1D arrays. I am wondering if there is anyone out there willing to help me out because the project is due tomorrow as well as my final exam for a intro to c++ class. i am in the same EXACT situation as harleyrider, if anyone has seen his thread. same class, same project. decided to come on here myself to seek help. first of all, i would like to clarify our project. BASICALLY:
the project requires that we make two simple 1D arrays. 1) the first will hold numbers from 1 -> a number the user inputs, in inremental order. 2) in the first array, a counter should count, starting from 1, three spots, then remove that number from the list, and dump it into a second array. and then it should continue counting from the next number till it hits the third spot from there. it should repeat this cycle until there is one number left. to clarify, here's an example: 123456 initial list of numbers, start counting from 1 12456 number 3 is eliminated, dump into second array continue counting from 4 1245 suitor 6 eliminated, dump into second array continue counting from 1 125 suitor 4 eliminated, dump into second array continue counting from 5 15 suitor 2 eliminated, dump into second array continue counting from 5 1 suitor 5 eliminated, dump into second array 1 is the lucky winner my problem is i have basically no idea where to start. i have sribbled down some code. but i don't know how to: 1) get every third number: 2) input every third number into second array 3) display output exactly like the example above CPP / C++ / C Code:
thank you for your time and help |
|||
|
#2
|
||||
|
||||
|
Deja vu! :-D
Code:
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#3
|
|||
|
|||
|
thank you so much for helping me walt. however, i should probably have said that i'm not allowed to use pointers or new/delete, as we have not covered that in class. is there a i guess i should say "dumber" way around it. the only thing i'm positive i have, is that i'm able to set the first array, winnerArray, with numbers incrementing in order from 1 and up, with the max number = to the number the user inputs. but i have no idea as how the loop would work for taking out every third number, removing it and dumpin it into a second array. also, once the count reaches the end of the first array, it must continue counting to the beginning of the array. i don't know how to do that either?
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sorting Algorithms by Time | silicon | C++ Forum | 4 | 02-May-2005 22:54 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 22:26 |
| more array help (simulation project..) | dilmv | C++ Forum | 6 | 17-Oct-2004 08:51 |
| Need help on simple Programming Project | daNichex6 | C Programming Language | 1 | 03-Sep-2004 19:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The