Exploding land mines cause damage to military vehicles, Programming Languages

In combat simulation software, exploding land mines cause damage to military vehicles. In addition to the damage done to the vehicles themselves, we are interested in the number of injuries suffered by the individuals inside of the attacked vehicle.

Your program should read a file named "vehicles.txt" and another file called "selection.txt".Your program shall compute the expected number of human casualties due to an explosion near a vehicle. See next page for sample input and output.

You may assume that all data in the file are valid, so you don't have to edit them.



Create text files in the format shown below for your development and testing. The grader will use two files created by him/her in order to test your program's functionality.


See sample output below. All float data should be output with 3 decimal point precision.You may need the iomanip and cmath packages depending on your system settings.

Use the function below for calculating the expected casualties

doubleexpectedCasualties (doublecasualtyProbability,



    return sqrt(casualtyProbability) * capacity;


vehicles.txt contains a list of vehicle types. For each vehicle type, the probability that people inside the vehicle would be injured due to an attack against the vehicle as well as the number of people in the vehicle are listed.

sampleinput file 1:vehicles.txt

Tank         0.2          5

Truck        0.85         14

Motorcycle   1.0          1

// Vehicle   prob.inj.    #personnel

selection.txt contains one vehicle name. This is the type of vehicle that is being attacked.

sampleinput file 2: selection.txt


sample output to screen:



Each of the values from vehicles.txt should be listed in a comma delimited format with the calculated expected casualty value appended to the end until the selected vehicle is displayed. The remaining records in the input file are ignored (notice that Motorcycle does not appear above).

If the vehicle matches the one in the selection.txt file, then surround that row with ** as shown for Truck above. If there is no matching vehicle, then your program should print out all rows from the vehicles file in a comma delimited format as discussed, but no rows will be enclosed by **.

Posted Date: 3/30/2013 1:59:12 AM | Location : United States

Related Discussions:- Exploding land mines cause damage to military vehicles, Assignment Help, Ask Question on Exploding land mines cause damage to military vehicles, Get Answer, Expert's Help, Exploding land mines cause damage to military vehicles Discussions

Write discussion on Exploding land mines cause damage to military vehicles
Your posts are moderated
Related Questions
I need help putting this into a flowchart constant c as Integer = 3500 Constant CALORIESTOOUNCE as Integer = 219 Declare Sex as Character Declare Age as Integer Declare Weight as I

Improved Application Deployment Data source implementation is perhaps the key to any Asp.net program implementation, and, if the database implementation is easily done, there is an

Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is

Extend the SpaceRocks game and provide a warp feature which allows the ship to jump to a random location to escape a rock. The warp feature is only activated once the shields have

Object-oriented programming paradigm Object  Oriented  Programming  is  an  aproach  in  which  a  program  is  viewed  as  a  dynamic  network  of collaborating objects, where

Implement the "Nuclear Reactor" example using the following:  An ISR triggered by a button press  A task to update the temperatures  A semaphore to communicate between the ISR and

i am stuck on array part from getting response of jquery. anyone could help?

How Can I Retrive Unicode CSV File the ADO.net VB.net

1.) Write a flowchart and program to do the following: A pressure sensor in a cooling system measures the pressure of the refrigerant and is connected to Port -1 of the 8051. If th

Introduction This assignment builds on your application, produced in Assignment 1, which holds a list of cabins, which can be either read in from a text file or just hard coded