So, I wrote this program for a friend. However, after the first variable input by the user, which is the variable "MONSTER", the program unexpectedly quits. Any help would be appreciated. I am using the DMC compiler.
Code:
#include <iostream.h>
//Calculates average percentage of item dropping//
char MONSTER;
char ITEMDROP;
char DROPRATE;
char DROPAMOUNT;
char MONNUM;
int main()
{
cout << "Welcome to Pantherias's Runescape Drop Percentage Calculator.";
cout << "This tool will determine how often a item drops after you input";
cout << "the neccessary data.";
cout << "Please enter the monster name, then press ENTER.";
cin >> MONSTER;
cout << "Now please type the name of the item being dropped,";
cout << "then press ENTER.";
cin >> ITEMDROP;
cout << "After you are satisfied with the fighting,";
cout << "type the number of the monster you killed,";
cout << "then press ENTER.";
cin >> MONNUM;
cout << "You are fighting" << MONNUM << " of " << MONSTER << " and attempting to recieve " << ITEMDROP << ".";
cout << "Please fight 100 of these monsters, then type in the amount of the item you get";
cout << "followed by ENTER.";
cin >> DROPAMOUNT;
DROPRATE= (DROPAMOUNT*100/MONNUM);
cout << "The " << MONSTER << " dropped " << ITEMDROP << " approximately " << DROPRATE << " percent of the time over " << MONNUM << " kills.";
return 0;
}
Comment