91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫CS9053、代做Java語言編程

時間:2024-02-15  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Introduction to Java
CS**53 Section I2
Wednesday 6:00 PM – 8:30 PM
Prof. Dean Christakos
Feb 8th, 2024
Due: Feb 15th, 2024 11:59 PM

Part I – Creating Objects

1.Square pyramid: In the lecture you have seen the creation of a circle. Here you are going to create a square pyramid. A square pyramid has a square base. It has base, a, and a height, H.




The Volume of a Pyramid is given by 
l is known at the “slant” and is given by 
The surface area of a square pyramid is given by   

You will create a class SquarePyramid using the following UML:


In standard UML parlance, “+” indicates that a field or method is public and “-“ indicates that a field or method is private. An underlined field or method indicates it is static.


Every time you create a new SquarePyramid instance, it should have a new sequential id, based on the value of nextId, which should be incremented every time you create a new SquarePyramid instance.


2.Objects and Arrays of Objects


Your objective is to develop the Hero and Party class and to use their methods. The classes are described below to guide you.



Hero

The Hero class contains data related to a hero in a video game. Implement the class according to the following UML diagram: 

Hero

Data fields
-name : String
-role: String
-level: int
-experience: int
-MAX_LEVEL: int

-ROLES: String[]
    Name of the Hero
Role of the Hero
Contains the level of the Hero
Contains the experience of the Hero
Constant static int containing the max level of 100.

The possible roles: “Warrior”, “Priest”, “Wizard”, “Thief” (ie, a static, pre-defined array of Strings)

Methods
+Hero (name: String) 


+setRole(role: String)



+getters for each non-static field

+expToLevelUp()
:int



+gainExperience(experience: int)
    














+toString()
    :String    Set the name to given value, set role to “Unassigned”, set level to 1, and experience to 0.

Set the role of the Hero. If the role is not one of the allowed roles, print “Invalid role” and set the role to “Unassigned”.


Get the name, role, level, or experience.

Return the amount of experience necessary to advance to the next level. The formula is level2. For example, at level 6, this should return 62 = 36. This is a helper method for the gainExperience method.

Increase the experience of the Hero. If the experience reaches or passes the maximum for the Hero’s current level, increase the level by 1 by “consuming” the necessary experience.
For example, at level 4 with 20 experience, the Hero should level up to 5 with 4 experience remaining. When a Hero levels up, print “<name> is now level <level>!” The max level is 100.

Note: If enough experience is gained at once, the Hero will level up more than once. For example, a level 3 hero receiving 75 experience will level up to 6 with 
(75 – 9 – 16 – 25) = 25 experience remaining. 





Return a String containing the information about the hero: 

Template:

“<name> the <role> is level <level> with <experience> experience.”

Example:

“Hagrid the Wizard is level 55 with 120 experience.”




Party

The Party class contains an array of Hero‘s that are in the party.
Implement the class according to the following UML diagram:

Party

Data fields
-heroes: Hero[3]
    Array of Hero’s in the current party.

Methods
+Party()


+addHero( hero: Hero, index: int) 



+removeHero(index: int)


+getHero(index: int)
    :Hero

+gainExperience(experience: int)


+toString()
    :String    Initialize the Hero array to hold 3 Hero’s. Initialize each element to null.

Add a Hero to the current party at the given index. If there is an existing Hero at the index, replace it. If the hero is already in the party, print “<name> is already in the party.”

Remove the Hero from the given index (to “remove” from the array, set the array element to null and shift any other elements to the left, so that the only nulls are at the end of the array).

Return the Hero of the desired index.


Prints “The party gained <experience> experience.”
Increase the experience of all the Hero’s in the Party.
Hint: Use each Hero’s gainExperience method.

Return a String containing the information about the hero.
Template:

“Party:
<name> the <role> is level <level> with <experience> experience.
<name> the <role> is level <level> with <experience> experience.
<name> the <role> is level <level> with <experience> experience.


Example:

“Party:
Thor the Warrior is level 10 with 4 experience.
Groot the Thief is level 20 with 19 experience.
Doctor Strange the Wizard is level 5 with 1 experience.“

Note: Only print assigned party members (Do not print anything if any heroes elements are null).
Hint: Use each Hero’s toString method.

After implementing this, create three heroes with names and roles of your choice, add them to the party, and give the party 100 experience points. Then print out the party by calling the toString() method for the party and passing it to System.out.println()
如有需要,請加QQ:99515681 或WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:代寫CS 476/676 程序
  • 下一篇:代寫COMP26020、代做Java,c++語言編程
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    亚洲视频一二三| 欧美成熟视频| 日本vs亚洲vs韩国一区三区| 一区二区三区欧美在线观看| 亚洲乱码国产乱码精品精可以看| 国产精品成人免费| 国产精品色哟哟网站| 国产精品网站在线| 亚洲三级小视频| 亚洲一区二区三区自拍| 亚洲国产美女搞黄色| 日韩综合在线视频| 免费人成在线不卡| 国产在线看一区| 处破女av一区二区| 色综合天天天天做夜夜夜夜做| 97精品视频在线观看自产线路二| 欧美精品国产| 亚洲九九精品| 在线免费精品视频| 日韩精品中文字幕在线不卡尤物 | 亚洲伦理精品| 午夜宅男欧美| 欧美丝袜丝交足nylons图片| 日韩亚洲国产中文字幕欧美| 亚洲精品一区二区三区精华液 | 亚洲人一二三区| 日韩福利视频网| 国产精品一二三四五| 欧美精品啪啪| 性一交一乱一区二区洋洋av| 欧美日韩一区二区在线观看 | 国产性做久久久久久| 一区二区三区在线视频免费观看| 日韩高清不卡一区二区| 国产中文一区| 精品白丝av| 欧亚一区二区三区| 久久久久国产精品厨房| 亚洲国产毛片aaaaa无费看| 九九国产精品视频| 欧美色123| 欧美主播一区二区三区| 国产欧美一区二区精品婷婷| 亚洲国产精品一区二区久久| 国产aⅴ精品一区二区三区色成熟| 欧美精品亚洲| 色婷婷av一区二区三区软件| 久久久精品免费网站| 亚洲国产精品人人做人人爽| 国产成人在线影院| 亚洲一区二区动漫| 精品国产伦一区二区三区观看体验| 一区二区在线观看免费 | 久久久久久黄| 久久久精品综合| 美女视频网站黄色亚洲| 狠狠88综合久久久久综合网| 欧美日韩电影在线| 亚洲日本va在线观看| 福利一区福利二区| 麻豆av福利av久久av| 国产三级精品三级| 国产乱码精品一区二区三区av | 在线综合亚洲| 国产欧美一区二区精品性色 | www.日本不卡| 欧美日韩不卡视频| 亚洲va欧美va人人爽| 欧美日韩视频在线一区二区观看视频| 欧美视频中文字幕| 亚洲一区精品在线| 国语对白精品一区二区| 日韩你懂的在线观看| 久久国内精品视频| 性一交一乱一区二区洋洋av| 欧美国产综合色视频| 成人免费视频caoporn| 欧美性一二三区| 无吗不卡中文字幕| 亚洲一区成人| 亚洲人成电影网站色mp4| 欧美精品大片| 久久久电影一区二区三区| 国产精品99久| 欧美夫妻性生活| 精品在线播放午夜| 欧美资源在线| 亚洲va韩国va欧美va| 中文精品视频一区二区在线观看| 中文字幕二三区不卡| 女生裸体视频一区二区三区| 久久综合久久鬼色| av成人免费在线观看| 日韩欧美一区在线| 国产69精品久久777的优势| 欧美久久久久久蜜桃| 精品中文av资源站在线观看| 欧美日韩免费观看一区三区| 午夜私人影院久久久久| 乱人伦精品视频在线观看| 亚洲高清视频的网址| 久久久天天操| 免费的国产精品| 欧美另类高清zo欧美| 国产成人在线视频网址| 日日欢夜夜爽一区| 国产精品日韩精品欧美精品| 一区二区三区在线不卡| 免费亚洲电影| 免费成人你懂的| 7777精品伊人久久久大香线蕉最新版| 国产一区二区在线免费观看| 欧美一区二区三区在线电影 | 日韩视频永久免费| 成人h动漫精品| 国产精品萝li| 久久精品国产清高在天天线| 青青国产91久久久久久| 91精品国产美女浴室洗澡无遮挡| 成人小视频在线| 中文字幕乱码一区二区免费| a91a精品视频在线观看| 日韩国产成人精品| 91精品国产入口| 亚洲欧美一区二区原创| 亚洲影视在线观看| 欧美剧情片在线观看| 91美女精品福利| 亚洲欧美色综合| 在线精品国精品国产尤物884a| 国产东北露脸精品视频| 国产精品国产精品国产专区不蜜| 久久国产成人| www.欧美色图| 亚洲综合自拍偷拍| 欧美久久久久免费| 黄色亚洲在线| 蜜臀国产一区二区三区在线播放 | 成人午夜伦理影院| 亚洲天堂免费看| 欧美日韩一本到| 欧美日韩国产亚洲一区| 秋霞电影一区二区| 国产午夜精品福利| 日本电影亚洲天堂一区| 欧美va亚洲va日韩∨a综合色| 亚洲h动漫在线| 欧美精品一区二区三区视频| 国产亚洲成人一区| 不卡av免费在线观看| 亚洲成人777| 久久久久久97三级| 在线精品国精品国产尤物884a| 成人av第一页| 日本中文字幕一区| 国产精品福利电影一区二区三区四区| 欧美综合亚洲图片综合区| 欧美午夜精品理论片a级大开眼界 欧美午夜精品久久久久免费视 | 亚洲一区二区三区在线观看视频| 国产传媒一区在线| 亚洲一本大道在线| 欧美经典三级视频一区二区三区| 91久久精品国产91性色tv| 国内精品久久久久久久果冻传媒 | 亚洲免费久久| 欧美福利影院| 国产成人免费av在线| 天堂va蜜桃一区二区三区 | 日韩av午夜在线观看| 国产精品进线69影院| 精品国产乱码久久久久久闺蜜 | 国产无人区一区二区三区| 欧美三区在线观看| 久久高清一区| aa国产精品| 黄色免费成人| 91影院在线观看| 高清日韩电视剧大全免费| 秋霞午夜av一区二区三区| 亚洲一区二区三区激情| 国产精品全国免费观看高清| 欧美成人精品二区三区99精品| 精品视频在线免费| 久久综合成人精品亚洲另类欧美| 欧美色网站导航| 色国产综合视频| 午夜在线精品| 亚洲一区二区在线看| 91久久久久| 亚洲日产国产精品| 亚洲福利国产| 91久久综合| 亚洲免费高清| 一本久道久久久| 一区二区三区久久网| 一本色道久久综合亚洲精品婷婷 | 日韩欧美高清一区| 日韩一二三区视频| 精品三级在线观看|