{"id":15479,"date":"2024-11-08T22:15:08","date_gmt":"2024-11-08T22:15:08","guid":{"rendered":"https:\/\/academicwritersbay.com\/solutions\/hw-3\/"},"modified":"2024-11-08T22:15:08","modified_gmt":"2024-11-08T22:15:08","slug":"hw-3","status":"publish","type":"post","link":"https:\/\/academicwritersbay.com\/solutions\/hw-3\/","title":{"rendered":"HW 3"},"content":{"rendered":"<p>HW3.docx<\/p>\n<p>Post the availability code .java files on Ecampus below the \u201cPost Homework\u201d menu choice.<br \/> 1.\u00a0In a single file named shapes.java, write class definitions for a square based\u00a0 Pyramid\u00a0and a\u00a0 Cone.\u00a0\u00a0These classes must have a constructor to pass values for the class variables.<br \/> Pyramid class variables: \u00a0 Width,\u00a0 Height Pyramid class techniques:\u00a0\u00a0 getVolume(),\u00a0 \u00a0getSurfaceArea() Cone class variables:\u00a0\u00a0 Radius, Height Cone class techniques:\u00a0\u00a0 getVolume(),\u00a0 \u00a0getSurfaceArea() 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.\u00a0 The code below will mean it&#8217;s doubtless you&#8217;ll possibly gain began with the critical program.<\/p>\n<p>Enemy Class<\/p>\n<p>Variables<\/p>\n<p>Description<\/p>\n<p>int Xpos, Ypos<\/p>\n<p>X,Y recount of the enemy.\u00a0 The tip left of the show conceal will be 1,1.<\/p>\n<p>char Avatar<\/p>\n<p>The personality that might perchance be displayed on the show conceal representing the style of enemy.<\/p>\n<p>String Form<\/p>\n<p>Enemy kind similar to \u201cOrc\u201d or \u201cTroll\u201d.<\/p>\n<p>int HP<\/p>\n<p>Hitpoints of the enemy.\u00a0 The enemy is deceased when HP is 0.<\/p>\n<p>int Attack<\/p>\n<p>Attack ranking of the enemy: The upper the amount, the more misfortune is does.<\/p>\n<p>int Armor<\/p>\n<p>Armor ranking of the enemy: The upper the armor, the less misfortune it takes.<\/p>\n<p>Suggestions<\/p>\n<p>Description<\/p>\n<p>Enemy(String theType)<\/p>\n<p>Constructor that takes 1 parameters \u2013 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&#8217;ll feature these items in step with the Form:\u00a0 Avatar, HP, Attack, Armor.\u00a0 To illustrate: if (Form.equals(\u201cOrc\u201d)) {\u00a0 \u00a0\u00a0 Avatar = \u2018O\u2019;\u00a0 HP = 50;\u00a0 Attack = 5;\u00a0 Armor = 20; }<\/p>\n<p>import java.util.*; public class shapes { \u00a0\u00a0 public static void critical(String[] args) \u00a0\u00a0 { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ demand particular person to enter values for pyramid Width and Height here \u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ suppose event of the Pyramid class and send width and height as parameters \u00a0\u00a0\u00a0\u00a0\u00a0 Pyramid Luxor = modern Pyramid(Width, Height); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ output volume and floor feature of pyramid \u00a0\u00a0\u00a0\u00a0\u00a0 System.out.println(\u201cQuantity = \u201d + Luxor.getVolume() + \u201d cubic meters\u201d) ; \u00a0\u00a0\u00a0\u00a0\u00a0 System.out.println(\u201cSurface feature = \u201d + Luxor.getSurfaceArea() + \u201d square meters\u201d); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ attain the identical thing with the Cone class \u00a0\u00a0 } } \/\/ Pyramid class goes here \/\/ Cone class goes here 2.\u00a0 Write a class definition for an\u00a0 Enemy\u00a0for your game.java<br \/> Write a critical program to illustrate your Enemy class:<br \/> 1.\u00a0 Produce an object of every of enemy (at least 3 quite a lot of forms). 2.\u00a0 Produce a 10\u00d710 array of characters named World (identical as in homework 2). 3.\u00a0 Set up the Avatar personality of every of the three kinds of enemies into the World. 4.\u00a0 Show World (identical as in homework 2) Instance output below exhibiting a dragon, orc, and troll in random places. . . . D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . \u00a0 IF THE ABOVE INFORMATION IS CONFUSING PLEASE SEE THE BELOW PICTURE<\/p>\n<p>image1.png<\/p>\n<p>image2.png<\/p>\n<p>image3.png<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HW3.docx Post the availability code .java files on Ecampus below the \u201cPost Homework\u201d menu choice. 1.\u00a0In a single file named shapes.java, write class definitions for a square based\u00a0 Pyramid\u00a0and a\u00a0 Cone.\u00a0\u00a0These classes must have a constructor to pass values for the class variables. Pyramid class variables: \u00a0 Width,\u00a0 Height Pyramid class techniques:\u00a0\u00a0 getVolume(),\u00a0 \u00a0getSurfaceArea() Cone [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-15479","post","type-post","status-publish","format-standard","hentry","category-solutions"],"_links":{"self":[{"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/posts\/15479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/comments?post=15479"}],"version-history":[{"count":0,"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/posts\/15479\/revisions"}],"wp:attachment":[{"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/media?parent=15479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/categories?post=15479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/academicwritersbay.com\/solutions\/wp-json\/wp\/v2\/tags?post=15479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}