Java代写:O BJECT -O RIENTED P ROGRAMMING I NDIVIDUAL P ROJECT 02代写留学生Java语言

Introduction基本思路:先根据作业给的类图理清楚代码框架的意思,对应函数的意思,然后绘出图形在对应位置,书的移动的话就是不停的刷新改变书的位置形成的动画效果注意点:绘图的时候位置不容易把握,要多次尝试.在书移动的过程中注意边界RequirementO BJECT -O RIENTED P ROGRAMMINGI NDIVIDUAL P ROJECT 02Project 02 BackgroundThis is an individual programming assignment. It is not to be completed as partof a team or with a peer programming partner.Your goal is to create a program that is made up of seven classes:CSC211Project2Project2PanelStudentTextbookDrawableInterfaceDrawableStudentDrawableTextbookThe application should draw two studentsand have the left student toss a textbook thatbounces between the two students. A demo ofthe application and several files to help youget started are available for download on thecourse web site.The project’s learning objective is to use inheritance to quickly create a pair of new object classesthat take advantage of work performed in previous labs and projects. The UML below showshow these classes relate together.+getX(): int+getY(): int+getLocation(): Point+moveTo(absX: int, absY: int): void+moveTo(whereToGo: Point): void+moveBy (dX: int, dY: int): void+move (): void+getVelocityX(): double+getVelocityY(): double+setVelocity(dvX: double, dvY: double): void+getColor(): Color+setColor(theColor: Color): void+draw(pen: Graphics): void«interface»DrawableInterface+tossBook(): void-Location: Point-xVelocity: double-yVelocity: double-shirtColor: Color-myBook: DrawableTextbookDrawableStudent-getBookInitials: String-checkBounds(pen: Graphics): void-Location: Point-xVelocity: double-yVelocity: double-bookColor: ColorDrawableTextbook+getName: String+getBook: Textbook+getHealth: double+getKnowledge: int+setName(theName: String): void+learnSomething(numPages: int): int-name: String-book: Textbook-health: double-knowledge: intStudent+getSubject: String+getPageCount: int+getUnreadPageCount: int+getWeight: double+readPages(numPages: int): int-subject: String-pageCount: int-unreadPageCount: intTextbookREQUIREMENTS FOR EACH CLASS CAN BE FOUND BELOW:The Textbook ClassYou should re-use your Textbook class from Project 1. To help resolve any issues or errorsyou may have had in implementing the class, a model solution has been posted on the courseweb site in the Project02 Starter Package.The Student ClassYou should re-use your Student class from Project 1. To help resolve any issues or errors youmay have had in implementing the class, a model solution has been posted on the course website in the Project02 Starter Package.The Interface DrawableInterfaceIn Lab 06 you designed the Java interface DrawableInterface and implemented it in theBall and Block classes. In this project, you will re-use that interface. The requirements for theinterface DrawableInterface can be found in the UML diagram above. This interface and itsmethods should be fully documented using javadoc style. comments.The DrawableStudent ClassThe DrawableStudent class represents the visualization of a university student. It shouldhave all the characteristics and behaviors of a Student, but also implement theDrawableInterface. You should implement all methods described in the interface,similar to the steps you took in Lab 06, except, instead of using a data field for the x-position and a data field for the y-position, use a single Point object.Because we need to draw our textbook, the Textbook data field of our parent will not beenough. We need to create our own DrawableTextbook data field, myBook. Yet, we stillwant to take advantage of the parent class implementation, so at the end of the constructor,call setBook(myBook) to replace the default parent class Textbook with yourDrawableTextbook.The DrawableStudent class needs a tossBook method that sets the velocity of theDrawableTextbook. You only need to set the x-velocity so the textbook moves to the right.If all the classes are implemented properly, the textbook will sense when it gets to the rightside of the window and revers direction back to the student.The DrawableTextbook ClassThe DrawableTextbook class represents the visualization of a university-level textbook. Itshould have all the characteristics and behaviors of a Textbook, but also implement theDrawableInterface. You should implement all methods described in the interface, similar tothe steps you took in Lab 06, except, instead of using a data field for the x-position and a datafield for the y-position, use a single Point object.You can use the following Java code to implement the DrawableTextbook class draw method:public void draw(Graphics pen){checkBounds(pen);pen.setColor(bookColor);pen.fillRect(xPosition, yPosition, 50, 70);pen.setColor(Color.DARK_GRAY);pen.setFont(new Font(“Monospaced”, Font.BOLD, 20));pen.drawString(getBookInitials(), xPosition, yPosition+50);}This method calls two private DrawableTextbook methods, getBookInitials andcheckBounds that you must implement.The checkBounds method should perform. similar to the checkPosition method in the twoprevious labs. If the book has moved to the edge of the window, the velocity in that directionshould be reversed and the book moved back into the window if it moved off.Since this method is a DrawableTextbook method, we don’t have access to the Paneldimensions. You can use the following code to get the clipping rectangle for the Panel by askingthe Graphics object pen:Rectangle edgeRect = pen.getClipBounds();The method getBookInitials creates and returns a string made up of the first letter of eachword in the textbook subject. Here are pseudo-code statements that perform. the task:String bookSubject = some string to parseString initials = bookSubject.substring(0,1);for (int i = 0; i本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(Java代写:O BJECT -O RIENTED P ROGRAMMING I NDIVIDUAL P ROJECT 02代写留学生Java语言)