HW3.docx
Post the availability code .java files on Ecampus below the “Post Homework” menu choice.
1. In a single file named shapes.java, write class definitions for a square based Pyramid and a Cone. These classes must have a constructor to pass values for the class variables.
Pyramid class variables: Width, Height Pyramid class techniques: getVolume(), getSurfaceArea() Cone class variables: Radius, Height Cone class techniques: getVolume(), getSurfaceArea() Your critical program have to demand the actual person to enter values for every of the variables and output the amount and floor feature of the pyramid and cone. The code below will mean it’s doubtless you’ll possibly gain began with the critical program.
Enemy Class
Variables
Description
int Xpos, Ypos
X,Y recount of the enemy. The tip left of the show conceal will be 1,1.
char Avatar
The personality that might perchance be displayed on the show conceal representing the style of enemy.
String Form
Enemy kind similar to “Orc” or “Troll”.
int HP
Hitpoints of the enemy. The enemy is deceased when HP is 0.
int Attack
Attack ranking of the enemy: The upper the amount, the more misfortune is does.
int Armor
Armor ranking of the enemy: The upper the armor, the less misfortune it takes.
Suggestions
Description
Enemy(String theType)
Constructor that takes 1 parameters – theType Initialize your class variable to the parameter: Form = theType; Space Xpos and Ypos to random numbers from 0 to 9. In the constructor, you’ll feature these items in step with the Form: Avatar, HP, Attack, Armor. To illustrate: if (Form.equals(“Orc”)) { Avatar = ‘O’; HP = 50; Attack = 5; Armor = 20; }
import java.util.*; public class shapes { public static void critical(String[] args) { // demand particular person to enter values for pyramid Width and Height here // suppose event of the Pyramid class and send width and height as parameters Pyramid Luxor = modern Pyramid(Width, Height); // output volume and floor feature of pyramid System.out.println(“Quantity = ” + Luxor.getVolume() + ” cubic meters”) ; System.out.println(“Surface feature = ” + Luxor.getSurfaceArea() + ” square meters”); // attain the identical thing with the Cone class } } // Pyramid class goes here // Cone class goes here 2. Write a class definition for an Enemy for your game.java
Write a critical program to illustrate your Enemy class:
1. Produce an object of every of enemy (at least 3 quite a lot of forms). 2. Produce a 10×10 array of characters named World (identical as in homework 2). 3. Set up the Avatar personality of every of the three kinds of enemies into the World. 4. Show World (identical as in homework 2) Instance output below exhibiting a dragon, orc, and troll in random places. . . . D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . IF THE ABOVE INFORMATION IS CONFUSING PLEASE SEE THE BELOW PICTURE
image1.png
image2.png
image3.png
- WE OFFER THE BEST CUSTOM PAPER WRITING SERVICES. WE HAVE DONE THIS QUESTION BEFORE, WE CAN ALSO DO IT FOR YOU.
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
QUALITY: 100% ORIGINAL PAPER – NO ChatGPT.NO PLAGIARISM – CUSTOM PAPER

Looking for unparalleled custom paper writing services? Our team of experienced professionals at AcademicWritersBay.com is here to provide you with top-notch assistance that caters to your unique needs.
We understand the importance of producing original, high-quality papers that reflect your personal voice and meet the rigorous standards of academia. That’s why we assure you that our work is completely plagiarism-free—we craft bespoke solutions tailored exclusively for you.
Why Choose AcademicWritersBay.com?
- Our papers are 100% original, custom-written from scratch.
- We’re here to support you around the clock, any day of the year.
- You’ll find our prices competitive and reasonable.
- We handle papers across all subjects, regardless of urgency or difficulty.
- Need a paper urgently? We can deliver within 6 hours!
- Relax with our on-time delivery commitment.
- We offer money-back and privacy guarantees to ensure your satisfaction and confidentiality.
- Benefit from unlimited amendments upon request to get the paper you envisioned.
- We pledge our dedication to meeting your expectations and achieving the grade you deserve.
Our Process: Getting started with us is as simple as can be. Here’s how to do it:
- Click on the “Place Your Order” tab at the top or the “Order Now” button at the bottom. You’ll be directed to our order form.
- Provide the specifics of your paper in the “PAPER DETAILS” section.
- Select your academic level, the deadline, and the required number of pages.
- Click on “CREATE ACCOUNT & SIGN IN” to provide your registration details, then “PROCEED TO CHECKOUT.”
- Follow the simple payment instructions and soon, our writers will be hard at work on your paper.
AcademicWritersBay.com is dedicated to expediting the writing process without compromising on quality. Our roster of writers boasts individuals with advanced degrees—Masters and PhDs—in a myriad of disciplines, ensuring that no matter the complexity or field of your assignment, we have the expertise to tackle it with finesse. Our quick turnover doesn’t mean rushed work; it means efficiency and priority handling, ensuring your deadlines are met with the excellence your academics demand.
