Question: Transaction Processing. Create a new C# . NET solution and save it in your Week 9 folder. Download the files, small _ weapons.txt and large
Transaction Processing. Create a new C# NET solution and
save it in your Week folder.
Download the files, smallweapons.txt and largeweapons.txt
from the COMPX library folder into your Week folder from
Moodle. For testing purposes you should use the small file. Use
the large file when you think the application works correctly. To
see what is in the files just open them in Wordpad or Notepad, don't
use Excel.
Nilesh is currently enjoying the action RPG game Torchlight
which is an awesome game and totally blows Auction House
Simulator oh sorry, that should be Diablo out of the water. He
has got a file containing info of some of the unique weapons in
the game.
The transaction file contains the following information:
Weapon Name string
Weapon Type string
Damage int
Weapon Speed double
To tell if one weapon is better than another you need to know the
Damage Per Second DPS the weapon does, since weapons have a
different attack speed. DPS is calculated by taking the damage
value and dividing it by the attack speed.
You will write an application that will allow Nilesh to load the file
and display the weapon info and DPS of every weapon in the input
file.When the user chooses to open a weapon file, they are required to
choose the file using the open file dialog window. It will then read
in the values about a particular weapon and then display the
values to the console window on one line neatly padded along with
the DPS of the weapon. This is repeated until the end of
the file.
Once the file has been processed, display a message to the user and
also say how many weapons were processed. The application just
needs two buttons, a ProcessFile button and an
Exit button.
a Write the pseudocode for processing a weapon file. Get a
demonstrator to check your pseudocode before going on to the
next step and save it into your project folder.
c Write a method called CalculateDPS which is passed the
damage value and speed value and returns back the DPS value as a
double.
d Write the code for opening a scan file and processing it based on
your pseudocode in a Use the CalculateDPS method to
calculate the DPS of each weapon.
e Modify your code from d so that the weapon information written
to the console window is also written to a text file. The user should
be able to specify the name of the file. Add a header to the
beginning of the file which has column headers for each column. At
the end of the text file display the total number of weapons in the
file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
