C++ Programming

posted by .

Create a class that holds robot warriors. Each has a string for their
name, a number of hit points (an float), armor (a defensive modifier(an int)), and weaponry (an offensive
multiplier(another int)). You will create 5 robots with a random number in each category (500 – 100 hit
points, 1 – 5 armor, 4 – 8 weaponry) and give them each a name. You will then have the five face off in
a little robo-warfare. For now, this just means that you will “sort” the list of objects by the highest hit
points, then by armor, then by weapons if needed. We will develop this further later on. Print out the
list as the output.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computers

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int temp; …
  2. Programming Language

    Create a method called countSelected, which takes an array of integers and an integer as input parameters and returns the number of occurences of the integer in the array. Example: data:{2, 1, 1, 8, 1, 0} select:1 ==> 3 public int …
  3. Programming

    The code below shows some of the text for a class called City. Now write a complete public constructor with two formal parameters: a String parameter called cityName, and an int parameter called cityPop. Your code should initialize …
  4. Computer Science

    public class RandomPhoneNumber { public static void main(String[] args) { int num1=(int)(Math.random()*7); int num2=(int)(Math.random()*7); int num3=(int)(Math.random()*7); int set1=(int)(100+Math.random()*642); int set2=(int)(1000+Math.random()*8000); …
  5. computer science

    Im trying to create an arraylist that's sorted but I have no idea how to sort the numbers. I cant use the array.sort method here is my code: public class Testing { private int [] data; private int count; private static int defCapacity …
  6. programming

    m trying to create an arraylist that's sorted but I have no idea how to sort the numbers. I cant use the array.sort method here is my code: public class Testing { private int [] data; private int count; private static int defCapacity …
  7. Java Programming

    I need to create a pseudocode for the follwing application: Write Java-like pseudocode to specify the logic for the following program application: Write an application that prompts an employee for an hourly pay rate and hours worked. …
  8. c# programming

    Trying to create a program using following algorithms. JumpSearch(list,lower,upper,jump,x) {Look for X in List[lower ... upper]. Report its position if found, else report 0. List is sorted in increasing order. upper>=lower>0; …
  9. Computer Programming

    I already posted this question but I gave it a try I'm not sure if I'm on the right track: Make a util class with three methods. First method's name is add, that returns the result by adding two numbers. Second method's name is multiply, …
  10. Java programming

    Hi, I'm trying to figure out how to implement toString() methods into the JavaTest and H2ClassB classes so that the output would be 4 3 7 5 99 3: import java.util.ArrayList; public class JavaTest { ArrayList <JavaTest> list = …

More Similar Questions