Course Solutions Uncategorized (Solved) : M Trouble Running Java Compiler Seems Wrong Error S Showing Error Cannot Find Symbol Int D Q29512578 . . . .

(Solved) : M Trouble Running Java Compiler Seems Wrong Error S Showing Error Cannot Find Symbol Int D Q29512578 . . . .

 

I’m having trouble running this through a java compiler.

What seems to be wrong with it?

The error that’s showing is from this:

error: cannot find symbol

int damageTaken = rand.nextInt(EnemyAttackDamage);

symbol: variable EnemyAttackDamage

location: class Main

import java.util.Random;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
  
//System objects
Scanner in = new Scanner(System.in);
Random rand = new Random();
  
//Game Variables
String[] enemies = { “Gargoyle”, “Ghoul”, “Barbarian”, “Hobgoblin”};
int maxEnemyHealth = 100;
int maxEnemyAttackDamage = 35;
  
//Player Variables
int health = 150;
int attackDamage = 45;
int numHealthPotions = 5;
int healthPotionHealAmount = 25;
int healthPotionDropChance = 55; //Percentage of drop
  
boolean running = true;
  
System.out.println(“Welcome to the Karamja Dungeon!”);
  
GAME:
while(running) {
System.out.println(“—————————————————-“);

int enemyHealth = rand.nextInt(maxEnemyHealth);
String enemy = enemies[rand.nextInt(enemies.length)];
System.out.println(“t# ” + enemy

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post