The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 313 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
I have attached my header, function definition, and main files for a program I am writing in C++. I am trying to solve a knapsack problem.
Â
My objective is to select a team of basketball players for daily fantasy basketball. The team has to fit under a $50,000 salary cap. I have to chose a player from each of the following positions: 1 each of Point Guard, Shooting Guard, Small Forward, Power Forward, Center, Any Guard, Any Forward, Any Player.
Â
If you run the main program in its current form you will see the out gives the player Damian Lillard twice.Â
Â
I cannot figure out how to loop through the array and get the next guard in the list that has not already been selected. Of course I will have this same issue when I try to select a forward and the player from any position.
Â
I have been going in circles for a while now so I would appreciate it if so someone can help me get past this point in the process.
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly