Using C++, create a simulation that will generate random targets (4 with a standard deviation of 1) which will assign them a value in two parts: a numerical value of -100 to 100, and a character value of A (air), S (surface), and U (under-surface). The simulation will run X (user input) amount of steps, and display the results for each step on the screen.
For example targets generated:
-100A will be a friendly air target that is close, while a 100S will be an enemy surface target that is close.
-10U will be a friendly under-surface target that is far, and 10A will be an enemy air target that is far.
Values -9 to 9 will be considered unidentified. Possibly using a priority queue to keep high value targets at the top to ensure they are addressed first.
Once the targets are generated with their values, they will then be assigned a weapon type depending on if they're an enemy or not. Each weapon type can target a specific target with a success chance to remove the target from the list:
Type 1 systems target Surface (S) types with a 96% success
Type 2 systems target Under-surface (U) types with a 98% success
Type 3 systems target Air (A) types with a 90% success
Type 4 systems target Surface AND Air (S and A) with a 88% success
Each system will be assigned to an enemy target depending on their threat, higher values first. Each step, the assigned systems will determine if they were successful in removing the target from the list. If so, they will them be assigned a new target. If not, the systems may be reassigned to the new targets generated, or stay assigned to original target. The simulation will end once all steps are processed (even if targets remain). However, it should display what targets remain at the end of the simulation. Allow the user to run the simulation again with a new step value.
Prompt user for number of steps
Step through the simulation
- Generate targets randomly -100 to 100 and A, S, U (base 4 with standard deviation of 1)
- Assign system types to to address targets 10 to 100, A, S, U depending on type
- Determine success of removing them from a list, reassign as needed
Continue to step through and generate/assign under end of number of steps
There should be a check to ensure user inputs valid input, positive integer instead of negative int, char, or str
Code should be commented to explain process and list/explain what data structures were used and why
Should be written as a console application using C++, supply .cpp file and any additional files needed (i.e header) to successfully run through CodeBlocks.
9 freelancers are bidding on average $162 for this job
Hi, Chris I just read your posting and interested in your project. I have rich experience in C/C+++ for over 10 years Important is I understood your project. Let's discuss more in chat Regards Paul