0 LIKES LikeUnLike
Everytime I try to compile this it says "parse error at end of input". Can anyone help me figure out how to fix this to get it to run?// // Create a window asking the operator for input regarding their base damage value// and then require the computer to calculate the resulting damage that does// to a leveled monster, using that monster's health value//#include <cstdio>#include <cstdlib>#include <iostream>using namespace std;int main(int nNumberofArgs, char* pszArgs[]){// enter the attack value of your characterint attack;cout << "Enter the base Attack Value of your character:";cin >> attack;// define the possible integer values for the different// creature name types enteredint nRobot;nRobot = 50;int nAnimal;nAnimal = 40;int nHumanoid;nHumanoid = 40;int nMonster;nMonster = 70;// enter the base health of the enemy creatureint kind;cout << "Enter the number corresponding to the enemy creature type:";cin >> kind;// define the type value depending on the creature typeswitch(kind){case 1: int health; health = nMonster;break;case 2: health = nAnimal;break;case 3:health = nHumanoid;break;case 4:health = nRobot;break;default: cout << "You didn't enter a valid creature type\n";// spawn random number for later useint randomNumber; randomNumber = rand()%11;// calculate equation for damage done to health depending on // attack valueint nBonus;nBonus = 10 + randomNumber;// use equation number to determine final enemy health depending // on relative damage doneint enemyHealth;enemyHealth = health - (attack+nBonus);// output the results (followed by a NewLine)cout << "Enemy Health is:";cout << enemyHealth << endl;// wait until user is ready to close the windowsystem("PAUSE");return 0;}
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 2 answers.