Be on schedule.Score better.

support@savemydegree.com

EN

A Fighter/Mage is one of the stronger multi-classes at the

A Fighter/Mage is one of the stronger multi-classes at the end of Baldur’s Gate 2, the seminal role-playing video game (cRPG) developed by BioWare. For character creation of a Fighter/Mage, the highest dice rolls should be allocated to strength (STR), intelligence (INT), dexterity (DEX), and constitution (CON) – in that order – and the lower statistics should go into wisdom (WIS) and charisma (CHA). Fill in code at the three (3) places marked YOUR CODE HERE. Upload your program.

 

import java.util.ArrayList;

import java.util.Collections;

import java.util.List;

import java.util.Random;

public class Main {

public static class dndCharacter {

private String name;

private int STR;

private int INT;

private int DEX;

private int CON;

private int WIS;

private int CHA;

public dndCharacter(String myName) {

name = myName;

List statList = new ArrayList();

// get 6 random stats

for (int i = 0; i < 6; i++) {

statList.add(characterStat());

}

// order statList low to high

Collections.sort(statList);

// access elements with statList.get(index) for index f

rom 0 to 5

// assign the character statistics high to low STR INT

DEX CON WIS CHA

// with values from the ordered statList

// YOUR CODE HERE

}

public String about() {

String aboutMe = “”;

aboutMe += “Hi! My name is ” + name+”\n”;

aboutMe += “I am a Fighter/Mage”+”\n”;

if (STR + INT + DEX + CON + WIS + CHA > 6 * 9) {

aboutMe += “I am rather good at questing\n”;

aboutMe += “Strength: ” + STR+”\n”;

aboutMe += “Intelligence: ” + INT+”\n”;

aboutMe += “Dexterity: ” + DEX+”\n”;

aboutMe += “Constitution: ” + CON+”\n”;

aboutMe += “Wisdom: ” + WIS+”\n”;

aboutMe += “Charisma: ” + CHA+”\n”;

} else {

aboutMe += “But enough about me…”;

}

// create the correct return statement

// YOUR CODE HERE

}

static int characterStat() {

Random random = new Random();

int d1 = random.nextInt(5) + 1;

int d2 = random.nextInt(5) + 1;

int d3 = random.nextInt(5) + 1;

int d4 = random.nextInt(5) + 1;

int diceSum = d1 + d2 + d3 + d4;

int min = Math.min(d1, d2);

min = Math.min(min, d3);

min = Math.min(min, d4);

diceSum -= min;

return diceSum;

}

}

public static void main(String[] args) {

// YOUR CODE HERE

// modify myName to initialize dndCharacter

Main.dndCharacter FighterMage = new dndCharacter(“”);

System.out.println(FighterMage.about());

}

}

Table of Contents

Calculate your order
Pages (275 words)
Standard price: $0.00

Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

The Apple Today

 Written over a hundred years ago, The Apple arguably still resonates today not only as a historical piece of writing that provides a window into

Internal VS External change agent

Introduction – What/Who is a change agent? – What does a change agent do? – What are the types of change agents? Body 1 –

Describe the “Scramble for Africa.”

Description Describe the “Scramble for Africa.” What was its importance to Europe? Who were the participants (both countries and individual people?) What were the impacts

New questions

Don't Let Questions or Concerns Hold You Back - Make a Free Inquiry Now!